Overriding expire headers

nfn

New Member
#1
Hi

I have a status site with static pages and images where I want to disable cache and set expire to 0.

I tried with htaccess:

Code:
<IfModule litespeed>
  RewriteEngine On
  RewriteRule .* - [E=Cache-Control:no-cache]
</IfModule>

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

<IfModule mod_expires.c>
  ExpiresActive Off
</IfModule>

<FilesMatch "\.(css|flv|gif|htm|html|ico|jpe|jpeg|jpg|js|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-r$
                Header set Expires "Mon, 10 Apr 1972 00:00:00 GMT"
        </IfModule>
</FilesMatch>
tried with headers in / context:

Code:
Cache-Control "no-cache, no-store, must-revalidate"
Pragma "no-cache"
Expires 0
These are html header:

Code:
content-encoding: gzip
content-length: 591
content-type: text/html; charset=UTF-8
date: Sun, 22 Dec 2019 10:38:15 GMT
server: LiteSpeed
status: 200
vary: Accept-Encoding
There are images header:

Code:
cache-control: public, max-age=604800
content-length: 1114
content-type: image/png
date: Sun, 22 Dec 2019 10:32:09 GMT
etag: "45a-5dfdf5c6-160269;;;"
expires: Sun, 29 Dec 2019 10:32:09 GMT
last-modified: Sat, 21 Dec 2019 10:36:54 GMT
server: LiteSpeed
status: 200
 

Cold-Egg

Administrator
#2
Hi,

OpenLiteSpeed only support rewrite rules in .htaccess. To turn off the cache control, please access to OpenLiteSpeed web admin ->Server configuration -> General -> Expires Settings and change from there

Best,
Eric
 
Top