How to enable LiteSpeed cache for your domain Print

  • litespeed, cache, lscache, htaccess, wordpress
  • 1

By default LiteSpeed cache is disabled and will need to be enabled manually. There are two ways to enable LiteSpeed cache for your domain.

1.) Install LiteSpeed Cache WordPress plugin. This is the recommended and easiest way to enable LSCache. Simply search for LiteSpeed cache in your plugins page in WordPress admin. Once installed just activate the plugin.

2.) Enable LSCache in your .htaccess file. You can create the .htaccess file in the folder where you have WordPress installed. The following will need to be added to the top of the .htaccess file.

 

<IfModule LiteSpeed>
CacheEnable public
RewriteEngine On
RewriteCond %{REQUEST_METHOD} ^GET|HEAD$
RewriteCond %{HTTP_HOST} ^example.com [NC]
RewriteCond %{REQUEST_URI} !login|admin|register|post|cron
RewriteCond %{QUERY_STRING} !nocache
RewriteRule .* - [E=Cache-Control:max-age=300]
</IfModule>

Replace example.com with the domain name that you want to enable LSCache. If you want to enable LSCache for multiple domains, separate them with the pipe symbol (|). For example:

RewriteCond %{HTTP_HOST} ^example.com|example.net|example.org [NC]


Was this answer helpful?

« Back