“The minified and combined files are cached.” Why?
-
I’m quoting the help documentation in the title. Why are we forced to cache the minified/combined files? Why not just load them as any other static file, and then I can use my own custom Cache-Control rules at the vhost level.
The short solution – have a toggle to choose to cache the generated files.
As it is, it’s breaking the site having these files sit in the LS cache because it adds on some wild headers of its own:
content-type: text/html; charset=UTF-8 cache-control: no-cache, must-revalidate, max-age=0 expires: Wed, 11 Jan 1984 05:00:00 GMT x-content-type-options: nosniff x-litespeed-cache-control: no-cache
Upon next refresh, I get 404s for the css and js files. I’m guessing this is due to giving the wrong content-type (both say
text/html
) and then the request gets invalidated bynosniff
, or it could be due to thatexpires
header from 1984.It doesn’t make sense to query the cache each time, when these are versioned/randomly named files. The best solution is to download once, cache locally, and don’t touch my headers 🙂
I have custom headers for these files in my vhost static context settings:
unset Last-Modified unset Cache-control set Cache-control max-age=31536000, immutable
(There’s no need for Last-Modified or Expires headers these days – all you need is Cache-Control and Etags, according to Google. Cuts down on header bloat.)
So please add a toggle switch to send to cache, and if it’s possible let me know how to unset all those weird headers set by the plugin… it’s obviously overwriting my custom headers in the OLS vhost settings.
- The topic ‘“The minified and combined files are cached.” Why?’ is closed to new replies.