In this tutorial, we are going to learn how to enable LiteSpeed Cache for WordPress.
LiteSpeed cache is an advanced server-level cache that will dramatically increase the performance of your WordPress installation.
LSCache is available free of charge with most of our hosting products including Elastic Hosting and Reseller Multi Account Hosting. If you are on a managed or self-managed cloud server you may need to license and install the LiteSpeed webserver in order to use LSCache. Please contact our support department if you are unsure about this.
To get started, please log in to the WordPress admin dashboard. We are now going to install the LSCache WordPress plugin. Click on Plugins -> Add New.
Now search for "LiteSpeed Cache" and install the "LiteSpeed Cache" plugin. Once the plugin is installed, click on activate to activate the plugin.
Now that the plugin is installed and activated, navigate to LiteSpeed Cache -> Cache and click "Save Changes" to ensure the configuration is written to the .htaccess file.
There are many different caching settings that can be adjusted here but, in most cases, it is recommended to leave these settings at the default values.
LiteSpeed cache is now activated and it begins improving your website speed immediately.
To test if LSCache is working as expected, we can look at the HTTP response header. You can either use a curl request or the developer tools in your browser to see the HTTP response header. For this tutorial, we are going to use the Google Chrome Developer tools to see the HTTP header.
From a non-logged-in Chrome window, visit the URL of your site, right-click, and then click Inspect to open the developer tools. Now select the Network Tab and reload the page with F5. Finally, select the page you are on and you will see the full HTTP response header.
We can determine if LSCache is activated and working as expected if we see "x-litespeed-cache: hit" in the response header. This means the page is being served by LSCache.
If you see "X-LiteSpeed-Cache: miss", this means the page has not yet been cached. Please ensure you are not logged in to WordPress and reload the page again and it should change to "hit".
If you don't see "X-LiteSpeed-Cache: hit" or "X-LiteSpeed-Cache: miss", then there is likely a problem with the configuration.
The LSCache plugin will automatically purge the cache after certain events such as updates to WordPress Core, Plugin, or Theme as well as after adding or editing posts or pages.
In some cases, it may be required for you to manually purge the cache such as after editing template files in the backend. To do this, hover over the LSCache icon in the top menu and click “Purge All” which will purge the cache entirely.
If you are unsure about how to proceed or require any assistance with this, please do not hesitate to contact our support team and we will be happy to install, configure, and test LSCache for you.