I’m setting cache control headers for files. I want to set max-age=86400 for all .css and .js, and max-age=3600 for all others.
<FilesMatch "\.(css|js)$">
Header append Cache-Control max-age=86400
</FilesMatch>
<FilesMatch "???">
Header append Cache-Control max-age=3600
</FilesMatch>
I can’t figure out what regex I should write to invert \.(css|js)$ match. Or maybe there is some other way to do this?
UPDATE. Based on this question answer I’ve found solution that works:
<FilesMatch "(?<!\.css|\.js)$">
Header append Cache-Control max-age=3600
</FilesMatch>
Unfortunatelly can’t find a way to leave dot \. outside of brackets. But still this solution fine for me.
As a side note, all other files include ones with not filename at all, like http://example.com/.
Based on this question answer I’ve found solution that works:
Unfortunatelly can’t find a way to leave dot
\.outside of brackets. But still this solution fine for me.