Disable Cache in PHP

#1
Hi,
We develop out sites in Concrete5 CMS and I've recently got a new VPS with Litespeed cache.
The sites are running nice and fast but one issue I have is that when I login I think the cache is causing some bugs with the CMS.
Is there a way in PHP to disable Litespeed? It would then just be a case of enabling/disabling if logged in or out
Thanks
Dave
 
#3
Thanks for your reply. The tricky thing is when logged into the CMS, you don't enter a folder, the url is unchanged. Therefore there is no admin area to add an .htaccess with the disable cache rules.

Would this exclude caching if viewing the site via the subdomain "admin" e.g. admin.domain.com?
Code:
<IfModule LiteSpeed>
 RewriteEngine On
 RewriteCond %{REQUEST_METHOD} ^HEAD|GET$
 RewriteCond %{HTTP_HOST} ^domain.com [NC] [OR]
 RewriteCond %{HTTP_HOST} ^www.domain.com [NC]
 RewriteCond %{ORG_REQ_URI} !^admin.domain.com
 RewriteRule .* - [E=Cache-Control:max-age=120]
</IfModule>
 
Last edited:

NiteWave

Administrator
#4
please try
Code:
 RewriteEngine On
 RewriteCond %{REQUEST_METHOD} ^HEAD|GET$
 RewriteCond %{HTTP_HOST} ^domain.com [NC] [OR]
 RewriteCond %{HTTP_HOST} ^www.domain.com [NC]
 RewriteRule .* - [E=Cache-Control:max-age=120]

 RewriteCond %{REQUEST_METHOD} ^HEAD|GET$
 RewriteCond %{HTTP_HOST} ^admin.domain.com$ [NC]
 RewriteRule .* - [E=Cache-Control:no-cache]
 
Last edited by a moderator:
Top