Frequent 404 errors with cached JS and CSS files
-
Our 404 monitor is detecting a significant number of 404 errors for Breeze’s minified and optimized files. I have verified the file permissions, and Breeze is successfully generating the files when I check them myself, and successfully renders whether I’m logged in or not, using a different browser. Although I rarely come across 404 errors myself, it seems to occur frequently for our customers. The 404 errors are specifically related to these files :
/wp-content/cache/breeze-minification/js/breeze_*.js /wp-content/cache/breeze-minification/css/breeze_*.cssIt appears that either these files are being deleted too aggressively or they are still being referenced in cached data after the cache has been purged. In either case, here is our current setup:
Cloudflare settings
- Browser Cache TTL : Respect Existing Headers
- Caching Level : Standard
.htaccess
ExpiresActive On ExpiresByType video/mp4 "access plus 1 month" ExpiresByType image/jpg "access plus 1 month" ExpiresByType image/jpeg "access plus 1 month" ExpiresByType image/gif "access plus 1 month" ExpiresByType image/png "access plus 1 month" ExpiresByType text/css "access plus 2 hours" ExpiresByType application/pdf "access plus 1 month" ExpiresByType text/x-javascript "access plus 2 hours" ExpiresByType application/x-shockwave-flash "access plus 1 month" ExpiresByType image/x-icon "access plus 1 year" ExpiresDefault "access plus 2 hours"Breeze Settings
- Cache system / Gzip compression / Browser Cache all enabled; Purge Cache After 1440 min; rest is disabled
- File optimisations are all enabled
Cloudways server settings
- Varnish Cache Lifetime : 24 hours (same as Breeze settings)
- Redis enabled
Other significant settings
- XML-RPC disabled except for Jetpack IPs and localhost (we tried to disable it, issue remains)
- Redis and Object Cache Pro enabled (we tried to disable it, issue remains)
- Woocommerce installed
The most straightforward workaround to this issue would be to delay deletion of generated CSS and JS files by at least the cache lifetime if this isn’t already the case. Is it a known issue among Breeze developers ?
The topic ‘Frequent 404 errors with cached JS and CSS files’ is closed to new replies.