Skip to end of metadata
Go to start of metadata

This is an optimization guide for wordpress using LS Server and LS Cache plugin in Wordpress.


Requirements
LiteSpeed Web Server
LiteSpeed Cache Plugin
Wordpress Installation
cPanel (Optional)


LiteSpeed web server can not be installed on your end if yo you not have cPanel root privileges. Follow LSCache documentation for this, if you have root privileges.


Installing Requirements 

To install requirements, first go to your Wordpress installation and add the LS Cache Plugin.

Go to WP-Admin → On the sidebar click on plugins → Add new → LiteSpeed Cache (Plugin should look like these)

           

Some providers show the option to check if LS Cache is properly enabled on their server. You will find the option in cPanel like the following image:

In this case click on LiteSpeed Web Cache Manager → Wordpress Cache → Scan Installation. This will show you the installations so you can enable LS Cache server on them, in most of the cases it is auto-enabled.

 

Click on Enable to make sure installation is working properly.


Getting to Work

Now it is time to get to work on the LSCache installation. This will help us a lot with image optimization, compression, thumbnails, CDN, etc.. But note that some of the features might break your website and will need additional tweaking. Depending on the plugins and Themes installed this might break the page. Please check and flush cache each time you make any significant change so that it is visible.


Suggestions: Enable automatic updates and notifications, so that the service runs as smooth as possible all the time. Go to Litespeed → General Settings → Automatically Upgrade → Enable . On that same page enable notifications and save it on the top right corer. Click on "Save Changes". You need to save changes each time you do a modification, as it will not be saved otherwise and your progress will be lost.


  1. First things first, make a connection between quick.cloud and your domain. For this go to "General"→ Domain Key → Request Domain Key. You will se a notice informing you:

    Please wait. You will be notified upon approval.
  2. Create an account at quick.cloud and link it. After the request has been approved, click on the button "Link quick.cloud"
  3. Go to "Cache" on the sidebar. You will see a notification if Litespeed web server is not installed, in this case, moving any setting here will render useless. Here you can enable all settings, as this will generally not generate an issue. Unless the site is very active in comments and has a lot of activity. In this case, you might see some delay in the comments being posted and being seen by other users.
  4. Go to TTL and place proper values for public and private cache. I would suggest you place both at the recommended values from Litespeed. 1 Week, unless you do not post much content or you post a lot of content. In this case, change values accordingly. 
  5. On the Purge tab you will see options to auto-purge your wordpress installation as soon as new content is posted. Be aware that this might crash your site if you have a lot of visits and content, as the CPU usage will skyrocket. Making it slow or unresponsive for long periods of time if you continue editing over and over. For small to mid sites it is safe to enable them. You can also schedule a website purge each day at a specific time.
  6. Enable "Server Stale" as this will: 

    If ON, the stale copy of a cached page will be shown to visitors until a new cache copy is available. Reduces the server load for following visits. If OFF, the page will be dynamically generated while visitors wait. Learn More
  7.  Next you have the ESI Tab, which is only useful if you need to optimize content for logged in users, generally it has no use if you have not many administrator users or you have a need for a high amount of users on your Wordpress installation.
  8. Object Cache tab. There you will need to have access to memcached or redis, which is not the case on many installs. So we will ignore it for now. If you want to read more about it, check it on LS Documentation.
  9. Browser Cache tab. This one should be enabled to reduce the amount of requests to the server. Just enable it and 1 year cache is good enough in this case, which is the default setting.
  10. Now go to CDN on the sidebar and enable quick.cloud or if you have another CDN, enable it. In this case we are focusing on quick.cloud CDN. For this just enable the setting and allow to load query remotely on google or cdnjs, it is your choice, both are equally as good. Afterwards make sure to enable it on your quic.cloud account. For this go to LiteSpeed Cache → General → quic.cloud dashboard → CDN → Enable. In case you are using Cloudflare, you will need to provide the server IP for this to work properly. You will have to change your CNAME on your domain for this to work, so if you have Cloudflare, you can stick with Cloudflare.
  11. Image Optimization. Here you should enable all but one setting, "Remove Original Backups" as this might create issues if files are not compressed to your liking. 
  12. Page Optimization. Here is the tricky part, if you are new to this, you should hire someone to do it. Making changes in the page optimization requires expertise of the plugin compatibility and issues that can arise. You can safely enable 
    1. CSS Minify
    2. CSS Combine
    3. CSS HTTP/2 Push
  13. For Enabling the rest you need to be very careful as this might break your page. This is basically trial and error, you can exclude some .css or .js that break the page, but this require advanced troubleshooting with additional tools and checks. For now just enable:
    1. Load CSS Asynchronously, Critical CSS, Critical CSS in Background, Unique CSS Files, Inlince CSS Async. Now this come hand in hand. You need Async CSS to load critical css and inline css async. So if loading your website with CSS Async does not work because some content needs to be loaded "above the fold" or needs to be loaded first, nothing else will work. You would need to find the exact css file that causes this problem or plugin. Rev Slider generally needs to have that setting enabled on the plugin for it to work properly. Some themes do not work with those settings. You will not be able to know this if you have not much experience. One way you can find out where is the problem is in google chrome javascript console. You will see a message telling which .css is not working properly and you will need to exclude it later on. 

      Your site might work apparently, but you need to delete cache in Litespeed on the admin bar at the top → click on LS Icon → purge All.  Also make sure to purge all your cache on your browser. Otherwise you might not detect issues that arise from this kind of optimization.

  14. Same goes for JS Settings. Go to the JS Settings tab. Everything can be enabled safely except async, as this causes problems most of the time. In this case the setting is called "load js deferred" 
    1. Do enable "Exclude Jquery" as this might help you with a lot of issues that might arise. 
  15. On the optimization settings tab you might enable everything but 
    1. CSS Inline and JS Inline, as this might cause the same issue as before. Some content might need to be loaded first.
    2. For DNS Prefetch control run your website on tools.pingdom.com and check for the most common dns requests. You can add them on the DNS Prefetch.
  16. Image Lazy loading in media settings is a great asset for getting better scores on google speed insights. Now, if the setting of "lazy load images" does not crash the site, it is safe to asume that all features will work except one. LQIP (Low Quality Image Placeholder), this might not work because it needs to be sent to quic.cloud for optimization. Sometimes this does not happen instantly and takes some time. So the website might break temporarily.
  17. Localization Settings does not break your site, you can enable it if it is useful to you.
  18. On the Tunning Settings you will be able to fix the css issues I commented before.  You will be able to exclude files and images.
  19. Now go to database on the sidebar. There you can clean all the junk of your database and convert everything to innodb. This has minor impacts on small to mid websites. But you should enable it as it is pretty safe to do so. Make sure to backup your database just in case.


That is pretty much how to optimize your website with LS Cache. But note that you might need an expert to do it, as this requires a lot of experience with sites with a lot of plugins. We can do that for you at Hosterlabs.net for a price of 35$ for each website you want us to optimize. You can contact us at support@hosterlabs.net . This is not an exact science and might require a lot of time for fine tuning. You might also not see much impacts in performance if the website was already pretty well optimized.

Write a comment…