I'm trying to set expires headers for JS and CSS files and I'm following the guide here: https://openlitespeed.org/kb/how-to-set-up-custom-headers/
This is how I have set up the context:
URI: exp:^.*\.(css|js)$ (I want to find any files with a .css or .js extension, some of the files may have a parameter on the end like ?v=123456 (which is the last modified time stamp)
Location: $DOC_ROOT/$0
Accessible: Yes
Enable expires: Yes
Expires by type: application/javascript=A86400, text/css=A86400
Header operations:
unset Cache-control
set Cache-control public, max-age=86400
All other things are blank/defaults
What happens:
The expires headers and settings work as they should but all matched files return a 404, such as:
https://xxx.co.uk/js/jquery-3.5.0.min.js
https://xxx.co.uk/slick/slick.min.js?v=1587560009
(replaced domain name with xxx.co.uk)
Removing the context and the files are all found again.
So the regular expression seems to be working, the expires/headers are added but I think the location isn't quite right so it's not finding the file maybe?
Any help would be greatly received!
TIA
This is how I have set up the context:
URI: exp:^.*\.(css|js)$ (I want to find any files with a .css or .js extension, some of the files may have a parameter on the end like ?v=123456 (which is the last modified time stamp)
Location: $DOC_ROOT/$0
Accessible: Yes
Enable expires: Yes
Expires by type: application/javascript=A86400, text/css=A86400
Header operations:
unset Cache-control
set Cache-control public, max-age=86400
All other things are blank/defaults
What happens:
The expires headers and settings work as they should but all matched files return a 404, such as:
https://xxx.co.uk/js/jquery-3.5.0.min.js
https://xxx.co.uk/slick/slick.min.js?v=1587560009
(replaced domain name with xxx.co.uk)
Removing the context and the files are all found again.
So the regular expression seems to be working, the expires/headers are added but I think the location isn't quite right so it's not finding the file maybe?
Any help would be greatly received!
TIA