?
avatar brianteeman
brianteeman
3 Mar 2021

From my understanding all css and js files are loaded with a media query string which is used for cache-busting. Ignoring the question of if the string is created correctly I am seeing some files that only have a version number as the query string or none at all. Is that intended behaviour

image

avatar brianteeman brianteeman - open - 3 Mar 2021
avatar joomla-cms-bot joomla-cms-bot - change - 3 Mar 2021
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 3 Mar 2021
avatar Fedik
Fedik - comment - 3 Mar 2021

Yes, that correct, the assets from /media/vendor contains ?version
Core assets (and other with undefined version property) contains "media version hash"
The fonts does not contain anything because they loaded by CSS files.

upd: ref comment #22435 (comment)

avatar Fedik
Fedik - comment - 3 Mar 2021

hm, joomla-alert.css should have a version, same as joomla-alert.js, need to look

avatar Fedik
Fedik - comment - 3 Mar 2021

joomla-alert.css should have a version

well, it have, but some files is doubled on your screenshot, same for color_standart.css

avatar brianteeman
brianteeman - comment - 3 Mar 2021

Core assets (and other with undefined version property) contains "media version hash"

Shouldn't every file that is in the user editable area eg /templates have a full hash

avatar Fedik
Fedik - comment - 3 Mar 2021

Shouldn't every file that is in the user editable area eg /templates have a full hash

that what I meant, they will have a hash, unless the asset have a specified "version" property https://github.com/joomla/schemas/blob/6f1d84553cff3ff050c29f4c19f58b63bd483ae8/json-schema/web_assets.json#L41-L45

it like this:
1 version property does not exists (or set to auto) => use hash, eg file.css?hash
2 version property is empty or set to false => no hash, no version query
3 version property has a version value => version value in query, eg file.css?version

case 1 is all core and custom assets, including /templates
case 3 all assets from /media/vendor
case 2 custom assets by someone, there no such in Joomla, but can be added by extensions

avatar brianteeman
brianteeman - comment - 3 Mar 2021

So in my screenshot the following are missing a hash

  • color-standard
  • fontawesome
  • joomla-alert
avatar Fedik
Fedik - comment - 3 Mar 2021

woff2 is a font file, it loaded by browser from parsing CSS, it depend how font-face defined in CSS files, not by Joomla

color-standard, joomla-alert

If you look on your screenshot you will see they are doubled in some reason, one with version and another without:
image

I not sure why, looks strange, does they also doubled in the page source HTML?

avatar Fedik
Fedik - comment - 3 Mar 2021

fontawesome.css

have a version instead of hash, because the asset defined in /media/vendor, and then file.css overriden in
templates/cassiopeia/css/vendor/fontawesome-free/fontawesome.min.css

upd. after this patch #32541 it will have a hash instead of version

avatar brianteeman
brianteeman - comment - 3 Mar 2021

joomla-alert is not a double. one is in media and the other in the template

avatar Fedik
Fedik - comment - 3 Mar 2021

why they twice?
to me it looks wrong, can be a bug, need to check

avatar dgrammatiko
dgrammatiko - comment - 3 Mar 2021

joomla-alert is not a double. one is in media and the other in the template

I think this one is overridden, eg the template has a valid override of the original (in the media/vendor folder) file. Maybe that's a bug.

A few days ago I did this #32485 that creates a version hash per static asset (right now only js) which actually is derived from the actual content of the file. It should be way more efficient than invalidating EVERYTHING on each update

avatar dgrammatiko
dgrammatiko - comment - 3 Mar 2021

One more thing about the fonts, we're doing it WRONG, we need a plugin like https://www.npmjs.com/package/postcss-url-versioner I will do a PR (unless someone is faster here)

EDIT We also need a similar solution for images ( I mean the ones in a SRC attribute)

avatar brianteeman
brianteeman - comment - 3 Mar 2021

I will leave you guys to work out a solution. Not something I can help with. Sorry

avatar dgrammatiko
dgrammatiko - comment - 3 Mar 2021

@brianteeman here's the solution for the urls: #32574

avatar Fedik
Fedik - comment - 3 Mar 2021

about doubled joomla-alert, someone who familiar with styling should fix this:

@import "../../tools/tools";
@import "../../../../../media/vendor/joomla-custom-elements/css/joomla-alert.css";

it produce css import, and so an extra request:
image

color-standard I cannot reproduce, I have only 1 and it is hashed

avatar dgrammatiko
dgrammatiko - comment - 3 Mar 2021

about doubled joomla-alert, someone who familiar with styling should fix this

Just remove the .css ?

avatar Fedik
Fedik - comment - 3 Mar 2021

may be, may be, not sure why it is not included, something scss specific?

avatar dgrammatiko
dgrammatiko - comment - 3 Mar 2021

Works for me here

avatar brianteeman brianteeman - change - 10 Aug 2021
Status New Closed
Closed_Date 0000-00-00 00:00:00 2021-08-10 07:24:42
Closed_By brianteeman
Labels Added: ?
Removed: ?
avatar brianteeman brianteeman - close - 10 Aug 2021
avatar brianteeman
brianteeman - comment - 10 Aug 2021

Resolved elsewhere

Add a Comment

Login with GitHub to post a comment