CraftCMS Admin still being cached

#1
Hi,

Strange one, even with the official htaccess rules for Litespeed and CraftCMS NOT to cache the /admin folder, it still is being 'hit'.

Any ideas at all please, driving me mad and effecting a redirect plugin/404s? TIA.

Here is my .htaccess file below (and doesn't matter if the Litespeed rules are BEFORE the rewrite to push all to https)

<IfModule mod_rewrite.c>
RewriteEngine On

RewriteCond %{HTTPS} !on [OR]
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule (.*) https://www.copierking.co.uk%{REQUEST_URI} [L,R=301]
# Send would-be 404 requests to Craft
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/(favicon\.ico|apple-touch-icon.*\.png)$ [NC]
RewriteRule (.+) index.php?p=$1 [QSA,L]
</IfModule>


########## Begin - Litespeed cache
<IfModule LiteSpeed>
RewriteEngine On
RewriteCond %{REQUEST_METHOD} ^HEAD|GET$
RewriteCond %{ORG_REQ_URI} !/admin
RewriteCond %{ORG_REQ_URI} !/index.php/admin
RewriteRule .* - [E=Cache-Control:max-age=28800]
</IfModule>
########## End - Litespeed cache

# 1 Month for most static assets
<filesMatch ".(css|jpg|jpeg|png|gif|js|ico|svg)$">
Header set Cache-Control "max-age=31557600, public"
</filesMatch>



<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/plain text/css application/json
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE text/xml application/xml text/x-component
AddOutputFilterByType DEFLATE application/xhtml+xml application/rss+xml application/atom+xml
AddOutputFilterByType DEFLATE image/x-icon image/svg+xml application/vnd.ms-fontobject application/x-font-ttf font/opentype
</IfModule>
 

NiteWave

Administrator
#3
1. this is required:
and doesn't matter if the Litespeed rules are BEFORE the rewrite to push all to https
2.
RewriteCond %{REQUEST_METHOD} ^HEAD|GET$
RewriteCond %{ORG_REQ_URI} !/admin
RewriteCond %{ORG_REQ_URI} !/index.php/admin
RewriteRule .* - [E=Cache-Control:max-age=28800]
please add one rule after above:

RewriteCond %{QUERY_STRING} p=admin/
RewriteRule .* - [E=Cache-Control:no-cache
 
Top