Adding custom headers to cached documents
-
I would like to add custom headers to files cached by LSCache. I was doing it from .htaccess but it no longer works as before. Exactly, I not able to add ETag from the .htaccess in the root directory of my WordPress install. I used this code before with success.
AddDefaultCharset UTF-8 FileETag MTime Size <IfModule mod_headers.c> Header unset Last-Modified Header set Cache-Control "no-cache" </IfModule>
What I want to get is:
– Server-side caching: LSCache seems to be working but I’m not sure. I can see the header x-litespeed-cache
hit but the storage directory is empty.– Client-side not caching but allow 304 Not Modified responses: I get this with Cache-Control “no-cache” and ETags. With these headers, the HTML document is not cached client-side but it is not downloaded in every request if it has not been modified due 304 Not modified responses.
I think I can not set ETags because MTime requires access to file’s information but the file is stored higher in the server directory tree, outside WordPress directory and out of the scope of the .htaccess, is it correct?
?Any suggestion?
- The topic ‘Adding custom headers to cached documents’ is closed to new replies.