* To enable LiteSpeed Cache if you are on our Managed/Dedicated Cloud Server, please contact our Billing Department (it's Free).
To enable LiteSpeed Cache with Drupal, add the following codes to the .htaccess file:-
<IfModule LiteSpeed>
CacheEnable public
RewriteEngine On
RewriteCond %{REQUEST_METHOD} ^GET|HEAD|PURGE$
RewriteCond %{REQUEST_URI} !admin|register|login [NC]
RewriteCond %{HTTP_COOKIE} !SESS [NC]
RewriteCond %{QUERY_STRING} !nocache
RewriteRule .* - [E=Cache-Control:max-age=300]
</IfModule>
Note:-
- The codes above must be at the top of the .htaccess file.
- To view the non-cached version of any URL, just add
&nocache
to the end of the URL. - If you have more than one domain in your public_htmldirectory, add the following line before the last two lines:-
RewriteCond %{HTTP_HOST} ^YourDomain.com [NC]