Cloudfront CDN minified CSS cache busting
-
How can I force W3TC to use a different filename when creating minified files?
For instance let’s say the following CSS files are being minified (manually selected on the Minify settings at https://mysite/wp-admin/admin.php?page=w3tc_minify)
https://mysite/wp-content/theme/mytheme/style1.css https://mysite/wp-content/theme/mytheme/style2.css
If I update these files and re-minify the name of the minified CSS file remains the same, even though the content of the file has changed. I need the name of the minified CSS file to change so the CDN will see and immediately serve this new file on page refresh.
If I add a cache buster to the filename a new minified file name is generated:
https://mysite/wp-content/theme/mytheme/style1.css?2
However I get the following error when attempting to minify:
Recently an error occurred while creating the CSS / JS minify cache: File "/var/www/wp-content/themes/mytheme/style1.css?2" doesn't exist.
And the minified CSS file no longer contains
style1.css
How can I either:
A) Force a new minified CSS file name when the file contents change. (And not when filenames change)
B) Use query variables when manually entering CSS files to minifiy.
- The topic ‘Cloudfront CDN minified CSS cache busting’ is closed to new replies.