How to Configure the Litespeed Cache Plugin to Speed Up Your WordPress Website

With dynamically developing technologies, every user today expects a website to load quickly. This can be achieved in various ways, but the most important is the so-called cache.

But what does cache mean?

When a user loads a website, a copy of the displayed page is saved on their device (laptop, phone, tablet…). This way, the information is displayed much faster the next time it is loaded. This is called the browser cache.

The speed at which a website loads also has a significant impact on its ranking in search engines such as Google, Bing, etc. - SEO (Search Engine Optimisation or page optimization for search engines).

Caching and generally improving the speed of loading a website can be a daunting task for many people.

Considerable knowledge of programming languages - especially those used to develop the website - is required. This is where LiteSpeed Cache and the specially developed plugins come into play. Thanks to them, you can create a cache and improve the loading speed of the website without having extensive programming knowledge. Scripts have been developed for this purpose, which can be activated easily and conveniently using buttons.

In this material, we will look at what LiteSpeed Cache is, which systems can benefit from it, and how to configure the WordPress plugin correctly to achieve the best results and improve the loading speed of the website.

What Is Litespeed Cache and What Are Its Advantages?

Litespeed Cache is an efficient, highly configurable caching engine for web content. Its main advantages are:

  • Improves the dynamic loading of websites (typically PHP websites)
  • Improves the loading of static content (such as images)
  • Significantly reduces the consumption of system resources

Is Litespeed Cache Free?

Yes, Litespeed Cache is free of charge. It is integrated into the LiteSpeed web server itself and is provided free of charge. Plugins for CMS systems are also free of charge.

Litespeed Cache Plugins

LiteSpeed has ensured that larger standard systems have an easy way to manage their cache via plugins/modules. This gives the user more control and more accessibility, and for advanced users, there are options for fine-tuning.

Here is a list of systems for which you can find the LiteSpeed Cache plugin/module:

  • WordPress
  • Joomla
  • OpenCart
  • Prestashop
  • Magento
  • Drupal
  • Laravel
  • XenForo
  • MediaWiki
  • Craft CMS

Why Is Cache Important?

We have already given some information about this at the beginning, but let us look at this aspect in a little more detail.

Many years ago, websites were much simpler and the size served to users was in the order of kilobytes. With the advancement of technology, this aspect has already changed considerably.

The website itself must be extremely beautiful and functional (remember what websites looked like before the year 2000?), but this leads to its "weight" or loading a lot more resources. For this reason, the use of cache is now a mandatory factor. Its purpose is to make your website lighter.

But How Does Litespeed Cache Do That?

Most websites are built with dynamic content that is made available to the user when the page is loaded. The problem is that this content comes from multiple sources/files, is generated (e.g. if the page was created in PHP), and only then made available to the client. This process can often take up a considerable amount of system resources and be slow.

LiteSpeed Cache uses the "page cache" method, which takes all these dynamic resources and creates a copy of your page in a static HTML version. This way, the next user who "requests" this content will be served much faster and more efficiently.

Those of you in the know might mention that often pages with changes or sample content should not be cached. Of course, LiteSpeed has thought of these and other options. Their plugins offer the ability to clean the cache, disable the cache for individual elements, and much more.

How to Use Litespeed Cache in WordPress?

WordPress is the most widely used CMS system. Below we will show you how to install the plugin and how to configure it at a basic and advanced level. Let us continue with the steps:

Installing the Litespeed Cache Plugin for WordPress

  1. Open the admin panel (wp-admin) of your website
  2. From the left navigation select Plugins -> Add new plugins
This is what the WordPress admin panel looks like
  1. There is a plugin search field at the top right of this page. Enter the text “Litespeed cache” there
  2. In the center window for the first result, you should see “LiteSpeed cache”
These results are returned by the search engine in the plugins when you query "Litespeed cache"
  1. In the image above, you can see that there is an “Install” button. Press it and wait a few seconds.
  2. After installation, the button will change to “Activate”, then press it.

That's all you need to do to install the LiteSpeed Cache plugin in WordPress. Once you have completed these steps, it is already installed and activated for your site. With the installation, some options are enabled by default, but there are also disabled options. We will take a closer look at these below.

Configuring the Litespeed Cache Plugin for WordPress

The LiteSpeed cache plugin for WordPress was created by the developers of the LiteSpeed web server software that we at Hosting Jump use to provide our services.

Basic Configuration of the Litespeed Cache Plugin for WordPress

Here we look at the options you can enable that are unlikely to cause any difficulties in loading your website correctly. All settings are accessible via the WordPress admin panel - > LiteSpeed Cache (in the left menu).

1. category general

Domain key - select the "Request domain key" button on the right. The option itself is not technically an optimization but is required for other optimizations, which we will discuss below. Please note that the generation of the key itself can take several minutes.

Server IP - enter the IP address of the server on which your website is located. LiteSpeed's cloud servers will then address this address directly and not the domain name. This saves time due to DNS blocking.

2. category cache

ESI tab - Activate the first option “Enable ESI”. This can significantly speed up the loading of the Admin Panel. Use this option to activate the cache for logged-in users.

Section ESI- enable cache for logged in users.

Browser tab - from here activate the browser cache option. Although this type of cache is active at the server level, from this menu you have the option to set the expiration time/Browser cache TTL. By default, the default value is “31557600”, which equals 1 year.

This is the recommended value from Google, and when checking with a PageSpeed tool, you will not get a warning about it. Also, your PageScore will be higher.

3. category Page Optimization
  • HTML Settings tab

The options we recommend to enable are:

DNS Prefetch - Enter the domain name of your page in the format “//domain.com”.

DNS Prefetch Control - On

DNS Prefetch Control - turn on the option - On

Remove Query Strings - On

Let us pay a little more attention to this option. You may have noticed that some files on your website are named “….name.css?ver=6.2.2”. If you remove the query strings, only the last part will be removed and the file will end in .css. In this way, you ensure that the caching of the static files works correctly. If a file version changes, the cache must be emptied. We will go into this later.

Optional - You can also remove the Wordpress Emoji if you do not use them.

Here's how to also remove Wordpress Emoji if you don't use it.

Recommended Configuration of the Litespeed Cache Plugin for WordPress

These are the options that we recommend activating and should not usually cause any problems with the correct loading of your website.

  1. All the basic settings we have described above
  2. Category Cache
  • Section Object

Firstly, you need to familiarise yourself with which object cache your hosting provider supports. HostingJump customers can take advantage of the Redis Object Cache. The instance activation itself takes place via the cPanel.

Once you have the necessary information, tick the "Object Cache" box, select whether you want to use Redis or Memcached, and fill in the "Host" and "Port" fields.

Please note that if you use more than one WordPress website and Redis for them, you must enter a different value for "Redis Database ID" for EACH website - from 1 to 15.

If you use more than one WordPress site and Redis for them, you need to fill in a different Redis Database ID value for EACH website - from 1 to 15.

If your hosting provider tells you that you need to use a username and password, you will of course also enter this data (typical for memcached).

3. category Image optimization

Image optimization is a very important process that can significantly improve the loading times of your website. In our practice, we often see that a webp version can be up to 60-70% smaller than the original file. A smaller size also means faster loading on the client side. We would like to point out at this point that we do NOT recommend adding images larger than 300kb.

  • Section "Settings for image optimization" - before you continue with the actual image optimization, you need to change some settings, namely:

Auto request cron - activate this option. This means that when you upload a new image, it is automatically optimized.

Image WebP Replacement - automatically replaces images with their webp version.

  • Section “Image Optimization Summary”

The optimization itself does not take place locally, but on a remote server (on LiteSpeed). The first request (the “Send Optimisation Request” button) only sends one image. The second request sends 20 and so it goes on until 200.

This is done so that the first requests can check whether the communication between your server or the server hosting your website and LiteSpeed's server is correct.

We emphasize this because users are often under the impression that they have to go through this process for every image when this is not the case. The scale for this number is progressive.

4. category Page optimization ( CSS/JS minify, Media settings )

In the following, we will mainly describe the activation of Minify. In short, it is a process for removing superfluous content from a CSS/JS/HTML file. This mainly involves whitespace and comments. In this way, the size of the file itself is reduced and it loads faster as a result. We will show you visually what this looks like:

Before:

minify -  before

After:

minify -  after
  • Section CSS Settings

Enable “CSS Minify”

  • Section “JS Settings”

Enable “JS Minify”

  • Section “HTML Settings”

Enable “HTML Minify”

IMPORTANT!!! Please note that in rare cases, activating these options may result in CSS/JS files not loading correctly. You can find out how to solve this problem in the advanced section. However, if you do not wish to carry out these steps, you can also deactivate the problematic options.

5. Category "Database"

Before we look at the options themselves, we would like to give you more information about “post revisions". When you write a new post, the information it contains is automatically saved after a certain time, and then a "post revision" is created, or in other words - a version of the publication.

The option itself is very good, because you can revert this post to an earlier version if necessary, but this also has its drawbacks.

Every revision is recorded in the database and so an enormous amount of unnecessary information is often imported and stored. Over time, there can be a noticeable delay in loading your website, precisely because of a large/problematic database. To avoid this, LiteSpeed offers several options:

  • Section “DB Optimization Settings”

There are no ideal values for the two options - Maximum number of revisions and Maximum age of revisions. Depending on how often you use the Revisions option, you can make these settings. It may be advisable to set the number to 5 and the time to 10.

For Advanced

Everything we have mentioned above should not hurt your website. If you are happy with the results, we recommend you stop here. Any of the options below can "break" your website to some degree.

IMPORTANT!!! We would like to point out that you can undo any action by simply deactivating the options you have activated.

Before you start making changes, we recommend that you make them during a period when there is little traffic on your website.

1. “General” category
  • Section General Settings

Here you can activate the first option “Update automatically". This will automatically update the plugin itself. LiteSpeed often has the practise that when a new option is published, it is no longer available by default. This avoids problems after updates, but it is still possible that there are bugs in the plugin itself or similar.

2. Section "Cache"
  • Section Exclude

You have the option of entering addresses, categories, cookies and more, which are then excluded from the cache. We do not necessarily recommend using this option. If a part should not be cached, it is better to put it in an ESI block. You can find more information on this here.

3. Section “Page Optimization”
  • Section CSS Settings

CSS Combine - Combine a group of CSS files into one. This will reduce the total number of requests to your site. We provide you with an illustrative example:

Before:

CSS Combine before

After:

CSS Combine after

If a CSS file does not function correctly after this procedure, you have the option of excluding it from the optimization. To do this, access the "Setting - CSS" section and in the CSS field Exclude file name/address.

Load CSS Asynchronously - asynchronous loading of non-critical CSS files. This can significantly improve the speed of your website and eliminate "Render Block" style issues in PageSpeed tests.

Font Display Optimization - option adds “Font-display” to all @font-face

  • Section JS Settings

JS Combine - how the CSS option combines multiple JS files into one. Please note that "you can specify files that in the "Tuning" section you can specify files that will not be included in this optimization.

Load JS Deferred - it is advisable to test the Deferred option, which can improve the PageScore result.

  • Section Media Settings

The most important options here relate to Lazy Load. This can be very useful if you have a lot of images on a page. When the user loads the page, not all images are loaded, but only the ones the client sees. When he scrolls down, they are loaded. In this way, you can significantly influence the selected requests that the page performs.

As there is no standardization when creating WordPress themes, there may be difficulties when loading the image, but we strongly recommend that you test this option. We focus on such as Preload Featured Images, Lazy Load Images и Add Missing Sizes.

If you have added iframes, also activate “Lazy Load Iframes”.

We pay special attention to the “Basic Image Placeholder”. If lazy load is activated, you may notice for a fraction of a second that a grey image appears in its place before the image is loaded. You can use this option to set it so that it is not grey but a different color.

  • Section VPI

This section is directly related to Lazy Load. If you do not want the first images that are loaded when the page is opened to be Lazy Load, activate both options here.

  • Section Localisation

"Gravatar Cache" and "Gravatar Cache Cron" can be enabled. If you do not know what Gravatar is, you can get more information here.

Other Situational Options

The LiteSpeed Cache plugin also offers many situational options. We will look at these below, but you should bear in mind that they are not always applicable or practical. Depending on the nature of your website, consider whether it makes sense to use them:

1. general category
  • Section General Settings

The "Guest mode" option provides each user with a cached version of the website. If there is new content, an additional AJAX request is made to retrieve and upload the new content.

If your website is static, this option is great, but it is not useful for a dynamic website. Also note that an additional POST request is made, which may require additional system resources.

2. cache category
  • Section Cache

“Cache mobile” creates a cached version for mobile devices. An extensive POST request is also created here, which can lead to your website being temporarily delayed.

  • Section “Advanced”

The "Instant click" option - when a user moves the mouse over a link, this link is loaded. This creates a cache before the user has even clicked on it and the page loads much faster.

IMPORTANT!!! This option can consume an enormous amount of system resources. We recommend that you only activate it if you have enough of them.

3. CDN category

If you use Quic.cloud or CloudFlare, you can connect the WordPress installation to the CDN yourself.

We also recommend that you complete the options for CloudFlare if you are using it. This way you can also partially control its cache. These options can be found on the CDN settings tab.

We also recommend that you complete the options for CloudFlare if you use it. This way you can also partially control its cache. These options can be found on the CDN settings tab.
4. Category Crawler

This is a bot that runs through certain URLs in a loop and saves them in the cache. This means that the first time a user visits the site, they are shown an optimized page. If the posts on your website are not updated often, this is a good option.

The configuration itself is done via the "Sitemap settings" tab. Here you only need to enter the address of your sitemap. If the domain name appears in it, also select the option "Remove domain from sitemap".

Drop domain from sitemap

Then activate the “Crawler" option on the "General settings” tab“. You can consider the other options, but no changes are required. However, if you wish and are familiar with the hosting environment, you can change them.

Clearing the Cache

Fortunately, clearing the cache is a very simple process. You don't need to delete any directories or anything like that.

In the WordPress admin panel, you will see the following icon in the top bar. If you hover over it with the mouse pointer, a drop-down menu opens. The options we are interested in are

  1. Purge All - Clears all cache, minify, and combine files.
  2. Purge LScache - Only clears the local cache.
  3. Purge CSS/JS cache - Clears JS/CSS cache only.
  4. If you have configured a CDN, you can also delete its cache.

It is recommended that you use the Purge All option, especially if you make frequent changes.

How Can Hosting Jump Help You?

Every customer who has trusted us and uses our WordPress support can benefit from having the plugin configured by us. Our team will activate all possible options that do not conflict with the theme or other plugins used.

WordPress Support by Hosting Jump

Conclusion

Litespeed Cache is a new and advanced technology that takes full advantage of the Litespeed web server. In combination with a plugin for your favorite CMS system, you can achieve both extremely fast performance and good PageSpeed results.

Hosting Jump - Premium hosting services at competitive prices!

Article from Tihomir Georgiev

With more than 10 years of experience in technical support, Tihomir's main objective is to train our customers in the use of the services or related software.

Social Networks:
More articles

Subscribe to Our Newsletter

With your subscription, you get more up-to-date news and our special promo offers

Subscribe to Our Newsletter