-
Notifications
You must be signed in to change notification settings - Fork 640
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[4.x]: css and js tag: support for gzip files #14243
Comments
This seems like a bit of a bad idea performance-wise… |
Hi Brandon, |
Sorry, I misread and thought you were asking for Craft to be able to serve gzipped files. I’ve just added support for Craft 4.8 is in development, but it’s safe to switch to now if you want to get the change early. To do that, change your |
Craft 4.8.0 is out now with that change :) |
Is there any documentation on serving pre-gzipped files to the browser? Wouldn't the browser be at the mercy of the server being configured to serve I'm not against Craft supporting this ... atypical usage, mind you... just curious if it's more widely accepted or used than I've thought. BTW, as an alternative solution to using |
@proimage I’m guessing it’s something that happens in the artifact build process, hence the |
What happened?
Description
The template tags css and js do not support gzipped file URL's (unless using absolute url's)
In the docs: To register a CSS file, the URL must begin with https:// or http://, or end in .css
(https://craftcms.com/docs/4.x/dev/tags.html#css)
In our project we have some CSS and JS files which are manually gzip encoded.
They have the extension .css.gz and .js.gz
Maybe the tag could support these files by allowing the file to end in ".css.gz" and ".js.gz".
Our workaround now is using a absolute path in the template tag:
Craft CMS version
4.7.0
PHP version
8.1
Operating system and version
Debian
Database type and version
No response
Image driver and version
No response
Installed plugins and versions
The text was updated successfully, but these errors were encountered: