LiteSpeed's official free policy is really great; after successfully configuring the domain key and binding it to your account, you can
The server used in this tutorial is a 雨云 2-core 2G one, because the LSCache plugin comes with a crawler that can crawl your own website and check the cache status. If it finds a page for which no cache has been created, the crawler will generate the corresponding version of the cache to speed up access; to crawl and generate cache quickly, you can use a server with a higher CPU frequency and more cores, and the memory should not be too small either
After installing the LiteSpeed Cache plugin, you can find this setting item in the admin backend - LiteSpeed Cache Settings - General. When setting it up for the first time, you can see an input box in the “Domain Key” section. Just click “Request Domain Key” next to it; after clicking, the button will turn gray and become unclickable, and it will display “Waiting for approval”, followed by how many seconds ago the request was sent and how much time remains until the next request.
Normally, it will request a key from QUIC.cloud once every 15 minutes. Once successful, it will change to what is shown in the following image:
Approval usually takes about 5 to 10 minutes to complete. If approval is not completed, you need to check the following:
- Whether the web firewall application is blocking the current online server IP
- Whether the web firewall application is blocking the callback URL (generally, a URL whose parameters contain the word litespeed is the callback URL; it is recommended to add it to the whitelist)
- Whether the domain is using the DDoS protection and automatic script blocking provided by Cloudflare. If so, please add an allow rule in the Cloudflare dashboard - your domain - Security - WAF, and you need to allow the current online server IP
After approval, you can bind the domain to your QUIC.cloud account according to the prompts.
LSCache Unavailable
This situation usually occurs because the web server installed on your server is not LiteSpeed or OpenLiteSpeed, but Nginx, Apache, or another web server such as a derivative version. In this case, you can enable the plugin's LSCache feature by switching web servers or enabling QUIC CDN. However, note that enabling LSCache for the plugin by enabling QUIC CDN is not truly enabling the LSCache feature; rather, it caches requests through CDN nodes to achieve an effect similar to LSCache. That is, when you choose to temporarily bypass CDN cache, no cache will be provided to you. Therefore, in this case, it is recommended to use a caching plugin together to optimize some access speed.
If you use the combination of 宝塔面板 + Nginx or Apache, you can install the “宝塔网站缓存加速” plugin to achieve an effect similar to LSCache, but this cannot eliminate the “LSCache Unavailable” prompt of the LiteSpeed Cache plugin.
So if you are a beginner, it is recommended to use QUIC CDN instead of switching web servers
Enable QUIC CDN
In the admin backend - LiteSpeed Cache Settings - CDN, find the Tab section above and select “QUIC.cloud CDN Setup”. Please translate and read the “Auto QUIC.cloud CDN Setup” section yourself, then find the “Set up QUIC.cloud Account” section and click the button below to start configuration. This process is fully automatic, and it is recommended to keep an eye on Dashboard - QUIC.cloud
The Domains column is the domain you bound to QUIC.cloud. Click the blue domain name to enter more detailed service usage statistics:
The four columns here correspond, from top to bottom, to the following services: CDN (Content Delivery Network), Image Optimization (i.e., image compression and other functions), Page Optimization (UCSS generation, etc.), and Low Quality Preview (when image lazy loading is enabled, first display a very low-quality but very small thumbnail to visitors)
Here we only need to focus on the CDN column. Click the blue CDN text to enter the configuration page. Clicking “Enable CDN” here can also start automatic configuration. Note that although deployment is fully automatic, SSL certificate generation is delayed, so if you want your website to be put into use as soon as possible, please prepare your own SSL certificate.
Custom SSL Certificate
Click “CDN Config” in the left-hand list, then click “SSL Certificate” to see the SSL certificate-related configuration
To use a custom SSL certificate, you must select “Manual Entry” in the middle radio option and fill in the certificate in the two columns below respectively
If it is an SSL certificate applied for from 腾讯云、阿里云, etc., please download it in Apache format
After decompression, you will get the files above. We need to fill the contents of “域名.crt” and “域名.key” into Certificate and Private Key respectively. Note: do not leak the certificate contents to anyone! If a leak occurs, revoke the leaked certificate immediately!
If you do not want to customize the certificate, you can keep this option at its default (the first one). The official service will automatically issue an SSL certificate for you within a certain period of time and will automatically renew it, so there is no need to worry about certificate expiration
After entering the information, click the blue “Save Custom Certificate” button to save the certificate configuration
Wait for a period of time and the CDN configuration will be completed
Return to the wordpress admin backend, open LSCache Settings --> CDN, select Configure CDN, then wait for data synchronization with the official service. Finally, enable Use CDN API on the current page to complete the configuration perfectly.
As of the publication of this article, the LiteSpeed Cache plugin version used is v5.6-rc1 (this is a beta version; I have sufficient configuration for the security of my own environment. Beginners must use the stable version! Otherwise, you may encounter XSS attacks, plugin crashes, WordPress fatal errors, etc.)