WordPress knowledge sharing

Tutorial of LiteSpeed cache plug-in installation and setting

LiteSpeed cache (LSCWP) is an integrated site acceleration plug-in that provides unique server level caching and website optimization functions. It supports a variety of web servers, such as LiteSpeed, Apache, NGINX, etc., and can use its common functions. LiteSpeed cache supports WordPress Multisite and is compatible with most popular plug-ins, including WooCommerce, bbPress and Yoast SEO, as well as ClassicPress.

 Tutorial of LiteSpeed cache plug-in installation and setting

No matter which service you use, Apache, NGINX, or LiteSpeed, you can install the LiteSpeed cache plug-in to speed up the website and use the general acceleration function of the plug-in. The core cache function can only be enjoyed in the OpenLiteSpeed/LiteSpeed service environment. If you want to enjoy this function, you can either use Pagoda panel deployment OpenLiteSpeed service , or use Hoster virtual host (with OpenLiteSpeed).

1. What is the acceleration effect of LiteSpeed cache?

First say the conclusion, the speed is extremely fast! After the personal test of Mr. Wei, the speed of the LiteSpeed cache plug-in is significantly improved after the installation of the LiteSpeed cache plug-in in the American server (pagoda panel) where the OpenLiteSpeed service is deployed. As shown in the figure below, the upper part is optimized by the nginx+wp rocket plug-in Gtmetrix website test score The lower part is the score after using OpenLiteSpeed+LiteSpeed cache plug-in.

Tip: gtmetrix scores fluctuate in a small range each time. The results in the following figure have been tested many times, and the scores with more occurrences are selected, which are representative.

It can be seen that the problem of "cumulative layout offset" that cannot be solved by the wp rocket plug-in has been solved by the LiteSpeed cache. It also reduces the "total jam time".

 LiteSpeed cache acceleration effect

Why is the OpenLiteSpeed service+Litespeed plug-in faster than other cache plug-ins?

Because this plug-in caches and accelerates at the service level, other cache plug-ins cache and accelerate at the application level, which is a big gap.

2. Can I use this plug-in in nginx or Apache services?

The answer is yes. The general acceleration function of LiteSpeed cache plug-in can be used. The OpenLiteSpeed service is installed in the above test server. The LiteSpeed cache plug-in provides server level caching, which is faster than PHP level caching.

If you want to use the cache function, you need to install the OpenLiteSpeed service. Otherwise, you can only use the ordinary acceleration function of the plug-in. Then using the LiteSpeed cache plug-in will lose its original meaning, because using the plug-in cache is our main purpose.

Optimize with WP Locket plug-in It can also play a very good acceleration effect. According to the test results of Lao Wei, the effect of OpenLiteSpeed+LiteSpeed cache plug-in is significantly better. All cache plug-ins can only be used one at a time, and cannot be installed and used two or more at the same time!!!

Hoster virtual host The OpenLiteSpeed service comes with it. You only need to install and enable the LiteSpeed cache plug-in in WordPress and set it according to the tutorial in this article.

These two plug-ins can coexist with memcached or Redis at the same time. They are very useful cache plug-ins.

3. LiteSpeed cache plug-in function

  • Free QUIC.cloud CDN cache
  • Object cache (Memcached/LSMCD/Redis) support+
  • Image optimization (lossless/lossy)
  • Shrink CSS, JavaScript, and HTML
  • Shrink Inline CSS/JS
  • Combined with CSS/JS
  • Automatically generate key CSS
  • Delay loading images/iframe
  • Responsive Image Placeholder
  • Multi CDN support+
  • Load CSS/JS asynchronously
  • Browser cache support+
  • Database Cleaner and Optimizer
  • Google PageSpeed Score optimization
  • OPcode cache support+
  • HTTP/2 push for CSS/JS (on the Web server supporting it)
  • DNS prefetch
  • Cloudflare API
  • Single site and multi site (network) support
  • Import/Export Settings
  • Attractive, easy to understand interface
  • WebP image format support
  • Heartbeat control
  • The service with+is not provided by the LSCache plug-in.

4. LiteSpeed cache plug-in installation enabled

In WordPress background>Plug in>Install Plug in, search for "LiteSpeed cache", install and enable it.

  LiteSpeed cache plug-in installation enabled

5. LiteSpeed cache plug-in settings

At the bottom of the navigation menu bar on the left side of the WordPress background, you can see the corresponding settings.

This plug-in has many items to set up. After Laowei's exploration and use, share them as follows.

5.1 The LiteSpeed cache dashboard can be skipped, because the results can only be displayed when the QUIC.cloud service is bound (the CDN QUIC.cloud is foreign, and its speed is not good in China). Not binding does not affect the acceleration effect.

 LiteSpeed cache plug-in settings

5.2 General

Automatic upgrade: When a new version is released, set this option to ON to automatically update the LiteSpeed cache. Close to update manually.

Do not change other options by default.

5.3 Caching rules: All with switches (except for caching mobile phone visitors) are enabled.

Caching mobile phone visitors: used for AMP pages and specific non responsive theme pages. Now they are all responsive topics, so it is recommended to close them.

Tip: If you do not install the LiteSpeed web service or use QUIC.cloud CDN, a warning will appear: the LSCache cache function on this page is currently unavailable.

5.4 TTL, Clear Rules, Exception Rules, ESI

Lao Wei has not changed these pages and uses the default parameters.

5.5 Object

  • Object cache: On.
  • Method: Select either Memcached or Redis. The plug-in will automatically detect which server is using.
  • Permanent connection: On. Keep the connection active. Memcached is faster.
  • Cache wp admin: closed. Cache the background of wp admin, but opening it may cause errors in saving background operations.
  • Save Transient: Open. Save the transient to the database when the cache wp admin is closed.

5.6 Browser

Browser cache settings: On.

5.7 Advanced

Improve HTTP/HTTPS compatibility: Off.

Immediate click: Close. Mouse over to preload linked content. However, the LiteSpeed Cache plug-in may have problems such as missing the JS file of the clicked page and unable to log in.

5.8 CDN setting

This refers to the use of QUIC.cloud CDN and Cloudflare. If they are used, they will be enabled and relevant parameters will be filled in. In particular, many foreign trade websites are using Cloudflare. You can open the API function and fill in relevant parameters.

5.9 Image optimization

Use QUIC.cloud server to optimize images, store optimized images, etc. If not, ignore it.

5.10 Page optimization

  • CSS settings: All are enabled.
  • Load CSS asynchronously: Close. Because the CDN of QUIC.cloud needs to be enabled to be valid.
  • Generate critical CSS: Close. It is used to communicate with the CCSS service of QUIC.cloud for the same reason.
  • Font display optimization: select Swap.
  • After CSS merging is enabled, clear all caches to make the merging effective.

5.11 JS setting: all are turned on.

Note that JS merging can easily lead to errors on the website page. After opening, you should observe whether the front page is normal. It is better to let people from all over the country help you visit the page more. If there is an exception, close it to see if it can be solved.

Load inline JS: select Deferred. If there is a JS problem, you can select After DOM Ready. If there is still a problem, select Default (Off).

Prompt: To enable the JS merge function, all caches must be cleared before it takes effect.

Note: If you find that a function of the foreground page fails after enabling css optimization and js optimization, such as the picture carousel is not displayed, you can view the specific corresponding css or js file from the source code, and then add the file name of the problem in css exceptions and js exceptions of the lite speed cache plug-in page optimization>tuning, In this way, you can eliminate problems and enjoy the performance and speed improvement brought by CSS and js compression.

Every time you modify the css exceptions and js exceptions, you must go to the toolbox and click purge all to see the changed page.

5.12. Optimization setting: All are turned on.

Asynchronously load Google Fonts: Close. The website is closed at home and opened abroad.

5.13 Multimedia settings

Delayed loading of images: When enabled, images are loaded only when they enter the field of view. Reduce the number of initial HTTP requests and shorten the page load time. The disadvantage is that when the image is not in view, it is a gray responsive placeholder, and the user experience is not good. Old Wei looks very awkward. You can decide after experiencing this.

LQIP Cloud Generator: Close. Because the QUIC.cloud LQIP (low-quality image placeholder) generator service is used, you have to close the cdn before using it.

Generate LQIP in the background: Close.

Inline delay loading image library: on. Used for inline JavaScript libraries that contain delayed loading images. This can improve the speed score of websites in services such as Pingdom, GTmetrix and PageSpeed. If there are various problems with opening the picture, close it.

5.14 Media exclusion

The type and address of the image delayed loading ranking. Leave blank.

5.15 Localization Settings

  • Gravatar cache: On. Store Gravatar avatar on the local server to speed up opening.
  • Gravatar Cache Cron: On. The cron scheduled task periodically refreshes the Gravatar cache.
  • Gravatar cache TTL: default.
  • Localize Resources: enabled. Cache remote files locally for optimization.

5.16 Tuning settings

Exclude css and js files.

Role exclusion: exclude an administrator from all plug-in optimizations. If a role is checked, any optimization effect from the plug-in is invalid.

5.17 Database Management

  • Optimize the database and regularly select Clean All. Before cleaning, the website database must be backed up to prevent accidents.
  • Database table engine converter: If MyISAM engine is displayed, the performance of converting to InnoDB engine is better, and the database must be backed up in advance during operation.
  • Database Summary: Displays the database.
  • The database optimization settings remain the default.

5.18 Crawlers

The crawler will refresh the expired pages in the cache in the website, reducing the possibility of visitors encountering uncached pages.

  • Map, blacklist and general settings are all default settings.
  • General crawler settings: enabled, other parameters are defaulted. If the CPU load increases significantly after startup, the cache speed slows down, and the delay increases, the system will shut down. Each website server is different, and your actual results shall prevail.
  • Crawler simulation settings are left blank.
    Site map setting: fill in the url of your site map.

5.19 Toolbox

Purge rules: LiteSpeed Web service must be installed or QUIC.cloud CDN must be used to use these purge rules.

You can select to clear the homepage, inner page, CSS/JS, object cache, etc. After the relevant cache settings are made according to the plug-in prompts, it is recommended to clear all caches.

Import/Export: upload and download corresponding rules.

Modify. htaccess: by default.

5.20 Heartbeat control:

Set the number of WordPress heartbeats to reduce server load. Disabling this feature may cause the WordPress task triggered by AJAX to not work. For example, some plug-ins and themes fail.

The most common examples of heartbeat packets are:

  • Update cart count in WooCommerce store when adding or removing products
  • Automatically save articles, drafts, and revisions in the WordPress editor
  • Show real-time plug-in notifications
  • Show when other users edit a post
  • Displays when the user is locked due to idle

Don't modify it if you don't understand it. It's OK by default.

6. Clean cache

When you have modified the website content, theme, and uninstalled the plug-in, you find that the page has not changed with it. At this time, it is recommended to manually clean the plug-in cache.

Generally, plug-ins will automatically clear the cache when they find changes in website content, but you have to do it yourself when encountering exceptions.

As shown in the figure below, you can see [Clear Rules] in the LiteSpeed cache toolbox. There are many separate clear buttons for different pages. Generally, Old Wei uses clear home page or clear all (including home page), which is used most frequently.

In most cases, when we don't know which pages should be cleared, just click Clear All, which is very useful.

The last red ink [Clear the entire cache] should be used with caution!

Each clearing rule is explained below, and you can operate after understanding the explanation.

7. Summary of LiteSpeed cache

The settings of the LiteSpeed cache plug-in are complex. If you can't understand many settings, you'd better not touch them or change them randomly to avoid an accident that may cause the webpage to be unable to browse normally. The server and virtual host of each website are different, and the same option to turn on/off also faces different results. The settings and parameters shared by Weiaisi's notes are just a reference. We should slowly explore and figure out a set of rules suitable for our website according to the actual situation of our business.

Early visible benefits: saving articles, previewing, timing, editing, publishing articles, opening articles, WordPress background settings, etc. all have a visual effect of about 50% speed increase. Old Wei is relatively satisfied. The long used wp rocket plug-in was also uninstalled, and the combination of OpenLiteSpeed service and LiteSpeed cache plug-in was intended to be retained to observe and monitor long-term conditions. Later, new conditions will be shared in the blog.

The effect of LiteSpeed cache is unanimously praised on the Internet, including the comparison with other WordPress cache plug-ins. However, no matter how sweet the candy is, not everyone may like it. No matter how good the iPhone is, some people can't get used to it. As for whether this plug-in is suitable for your website, I hope you can try it yourself.

Like( nine )
Article name: Tutorial on Installing and Setting LiteSpeed Cache Plug ins
Article link: https://www.vpsss.net/26355.html
Copyright notice: The resources of this website are only for personal learning and exchange, and are not allowed to be reproduced and used for commercial purposes, otherwise, legal issues will be borne by yourself.
The copyright of the pictures belongs to their respective creators, and the picture watermark is for the purpose of preventing unscrupulous people from stealing the fruits of labor.