In a previous post on our blog we discussed the idea of using the LiteSpeed page caching feature to improve performance of WordPress. The caching drastically improved the performance of a WordPress installation. You were able to go from just over 200 requests/sec to 1800 requests/sec with just a simple htaccess line. The LiteSpeed team have however worked on making it even easier to accomplish this with the introduction of their LiteSpeed Cache plugin for WordPress. With this plugin you have further control over your caching policies and can utilize a simplified htaccess mod_rewrite rule. I’m going to quickly go through how you install and configure the WordPress LiteSpeed cache plugin.
The initial step of course is to install WordPress which you can do through cPanel using Softaculous. There is no need to work with the cPanel file manager or an application like FileZilla. Just a few clicks and your WordPress is installed. Which now leads us to the point of this post is just how to install the LiteSpeed Cache plugin.
Step 1
The LiteSpeed cache plugin requires that you’re not using the plain permalinks option. You can change this by going to WordPress your admin interface and then ‘Settings => Permalinks‘. In most cases WordPress blogs are setup to utilize day and name but you can set them to any of the options and save the changes
Step 2
You are now ready to install the LiteSpeed cache plugin. You can do this by logging into your WordPress admin interface then going to ‘Plugins‘ and clicking ‘Add New‘. On this page put in Litespeed in the search bar and you’ll see the LiteSpeed cache plugin appear
You’ll then click the install now option which will install the plugin.
Step 3
Now that it’s installed you need to activate the plugin. You can do this in your WordPress admin interface by clicking ‘Plugins’ and then ‘Installed Plugins’. On this page you should see your list of plugins including the LiteSpeed Cache plugin. Click the activate option to activate the plugin.
Step 4
You will now see a settings option for the LiteSpeed cache plugin which you’ll click so you can start configuring the plugin. On this page you’ll be able to set the cache TTL, frontpage TTL, separate mobile caches and various other options. For most users the settings should be fine and you can just save the changes.
Step 5 (No Longer Necessary)
This setup is no longer necessary the plugin does this automatically for you.
You now need to let our web servers know you’re utilizing LiteSpeed Cache. You do this by modifying your .htaccess file and adding the following to the top:
<IfModule LiteSpeed> CacheLookup public on </IfModule>
The easiest way to do this if you’re not familiar with utilizing FTP or SSH is to use the cPanel file manager. Once you’re logged into cPanel you’ll go to ‘File Manager’ then navigate to your public_html folder. You’ll notice the .htaccess file is not there this is because by default cPanel hides hidden files. You can change this by going to your file manager settings and checking off ‘Show Hidden Files’ and clicking save
You can now select your .htaccess file and select to edit it which will open the file editor for it. Then all you need to do is add the LiteSpeed cache code to the top of the file. After this your file might look something like this:
<IfModule LiteSpeed> CacheLookup public on </IfModule> <IfModule LiteSpeed> RewriteEngine on ###LSCACHE START RESOURCE### RewriteRule wp-content/.*/(loader|fonts)\.php - [E=cache-control:max-age=3600] ###LSCACHE END RESOURCE### ###LSCACHE START FAVICON### RewriteRule favicon\.ico$ - [E=cache-control:max-age=86400] ###LSCACHE END FAVICON### </IfModule> # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress
You’ve now completed the installation and setup process of LiteSpeed Cache on Hawk Host and it’s time to take advantage of the speed increase.
Recently I’ve installed LiteSpeed Cache , I can feel improved page speed than the previous WP-Super Cache. Page speed drastically changed, I got my TTFB faster than 200ms and got no any warning from Google pagespeed insights.
wow new features. Thanks for hawkhost. I will try this plugin to my wordpress blog
Hello,
Can i use permalinks home/%postname%/
After install litespeed cache plugin, can i install w3 total cache too?
Because i like this plugin (w3 tc) to manage theme for mobile view
You can use any permalink structure it should work. As for mixing multiple caching plugins this is not recommended. Litespeed Cache plugin supports mobile specific views in it’s settings. Enabling both plugins would just result in you creating w3 total cache pages which would never get used as the Litespeed cache pages would be used.
I have a issue with W3 total chace and thrive visual editor. How can I solve this?
Interesting, I want to try it 🙂
Btw, LiteSpeed Cache vs W3TC, which one is better?
Thanks Tony.
In one of the comments you said we don’t need to use another Cache Plugin when Litespeed Cache is turned on. Without W3TC how can we use Memcached? (and does memcached provides any benefits when Litespeed Cache is on?)
Litespeed cache would be better than W3TC more than likely although it be pretty close if you’re using page caching of w3 total cache.
If you’re using Litespeed Cache there is absolutely no reason you’d even want to be using memcached with w3tc. The reason being if memcached is being used that means PHP was being used. Even with memcached it’s still going to be slower than Litespeed Cache or W3 Total Caches’s page caching method. My recommendation would be turn off W3 Total Cache and your Memcached instance and just use Litespeed Cache.
Thank you Tony.
I did on two sites and server loads reduced.
May be because W3TC itself eats up quite few resources every time WordPress loads.
No need to have a cache plugin. This is cool.
I have wp rocket onto my website, can use together with litespeed cache?
Hi, how to check if LSChache plugin is working correctly?
thank you !
Hi, guy,
I think there should be some update for this post
Once I installed the Litespeed plugin, I got the following code :
It seems that you don’t need to perform the Step 5 now. The plugin adds CacheLookup Public on by itself.
###LSCACHE START PLUGIN – Do not edit the contents of this block!###
RewriteEngine on
CacheLookup Public on
###LSCACHE START RESOURCE###
RewriteRule wp-content/.*/[^/]*(loader|fonts|\.css|\.js)\.php – [E=cache-control:max-age=3600]
###LSCACHE END RESOURCE###
###LSCACHE START FAVICON###
RewriteRule favicon\.ico$ – [E=cache-control:max-age=86400]
###LSCACHE END FAVICON###
###LSCACHE END PLUGIN – Do not edit the contents of this block!###
is this plugin support json api ?
I using WP Rocket and happy about it.
Should I switch to Litespeed cache? Which one is better?
@Jack
We’ll update the post as at the time of the writing of this post the plugin did not do this. We made a feature request and the Litespeed team implemented it.
@Tarun Kumar
Not sure what you mean it can cache any pages. Or do you mean if it has it’s own JSON API?
@Vy Spirit
The advantage is the Litespeed cache with us is free of charge. It is compatible with most major plugins and it is at least as fast if not faster than any other caching plugin. This is a web server based caching while others rely on serving static files to the users.
Thanks for your information about improve performance with litespeed.
it’s clearly enaugh.. 😀
I already use it for all of my websites and performance is really good.
It’s better than others standard caching plugins – W3TC, WP Super Cache, etc.
Oh new features. Thanks for hawkhost. My blog wordpress load very fast.
I love this plugin because of server caching. However, It conflicts with fixed TOC plugin when I enable combine, minify javascript while wp-rocket does not.
Could you please fix this issue?
Thanks.
@Alex
I’d recommend posting on https://wordpress.org/support/plugin/litespeed-cache and explain the issue you’re seeing. It sounds like either a bug or a compatibility issue that they could fix in the future.
is there any explain LiteSpeed Cache Settings?
Great, that is what I am looking for. However, I think I need to figure out another way as in my case I use another platform so no ready-to-serve plugin is available :-(. Any suggestion?
I love this plugin because of server caching. However, It conflicts with fixed TOC plugin when I enable combine, minify javascript while wp-rocket does not.
Could you please fix this issue?
Thanks.
If you’re having a compatibility issue with the Litespeed page caching plugin you would be best to post here: https://wordpress.org/support/plugin/litespeed-cache .
I should not using the plain permalinks option? like /%postname%/ ?
@Ahmad
That should work fine.
Ok, I’ll try and thank you for the recommendation
Hi Sir I Installed this plugin but my website speed not improve. My website – https://technicaldiwanji.com
Please suggest me how improve our website speed
Your website is loading exceptionally fast for me. It’s loading in about 500ms from the east coast in North America to Singapore and considering it’s about 250ms to Singapore it means the page rendered in under 250ms. What sort of speeds are you getting and what sort of speeds were you expecting?
Thanks for your information about improve performance with litespeed.
Google tools
Thank you for the information. Was able to installed the plugin with no issues.
Hi Sir i am Using your Hosting and last two days my CPU usage show 100% and my site down. pls how solve this problem
When I set up everything I can in the addition of litespeed and you can hardly see any changes – still about 40% mobile and 60% page desktops in google speed. My server handles it but you can’t see almost any difference I don’t know why.
thanks u very much boss.
i like use the plugin litespeed
good luck
thanks very much hawkhost.
i like this plugin,..
goodluck
This plugin is amazing. Thanks !
Nice plugin.. the fastest caching wordpress plugin as it would be the only one that leverages the built in capabilities of the web server.
I didn’t see significant result.
Nice plugin.. i’ve tried it Thank you dev