1

I'm having trouble with a server side cache with an OpenLiteSpeed server. I've tried the following .htaccess trick to try and turn this cache off. Can you tell me a wget command I can use to test my website to see if caching is disabled properly? I need to bust this cache on my website.

RewriteEngine On

RewriteRule .* - [E=Cache-Control:no-cache]

<IfModule mod_headers.c>
    Header set Cache-Control "no-cache, no-store, must-revalidate"
    Header set Pragma "no-cache"
    Header set Expires 0
</IfModule>

<FilesMatch "\.(css|flv|gif|htm|html|ico|jpe|jpeg|jpg|js|mp3|mp4|png|pdf|swf|txt)$">
    <IfModule mod_expires.c>
        ExpiresActive Off
    </IfModule>
    <IfModule mod_headers.c>
        FileETag None
        Header unset ETag
        Header unset Pragma
        Header unset Cache-Control
        Header unset Last-Modified
        Header set Pragma "no-cache"
        Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
        Header set Expires "Thu, 1 Jan 1970 00:00:00 GMT"
    </IfModule>
</FilesMatch>
ServerChecker
  • 1,498
  • 2
  • 14
  • 32

1 Answers1

1

If wget is the only option, try this command

wget -qS https://www.example.com/
  • q = --quiet
  • S = --server-response

Then you can filter "x-litespeed-cache-control" from result.

Please substitute www.example.com to your URL.

Eric
  • 111
  • 3
  • I tried it and didn't receive x-litespeed-cache-control header, although this is a LiteSpeed server because all of A2 Hosting's shared servers are LiteSpeed-based now. The only lines with cache in them are: "Cache-Control: no-cache, no-store, must-revalidate" and "Pragma: no-cache". Does that mean that cache is busted? – ServerChecker May 01 '20 at 17:24
  • That Cache-Control mean browser cache, not the full page cache part. Is that possible to share a test URL so I can help you more? – Eric May 01 '20 at 18:53