Disclosure: When you purchase a service or a product through our links, we may earn a commission. Read more...

Last updated:

QUICK GUIDE TO SETUP LITESPEED CACHE PLUGIN

Litespeed Hands On Visual

TipsMany of the optimization features can be used when using any of the following web servers: LiteSpeed, Apache, NGiNX, etc. The caching features, however, require either free OpenLiteSpeed, commercial LiteSpeed Enterprise Edition, LiteSpeed-powered hosting providers like A2 Hosting, or the new QUIC.cloud CDN.

General

Enable LiteSpeed Cache

You can enable LiteSpeed cache only when pre-requisites have fulfilled (read above). Otherwise, you should see the corresponding error message. You can peek here to get some overview of how to test the cache. NB! When disabling the cache, all cached entries for your website will be purged.

LiteSpeed Setting Enabled

Automatically Upgrade

Turn this option ON to have LiteSpeed Cache updated automatically, whenever a new version is released. However, it is strongly recommended to turn this OFF and apply updates manually.

LiteSpeed Setting Off

TipsFor all the Time-To-Live (TTL) settings you can easily use the default values that are already present. Probably you never need to change those values, because they work already the best optimum way for you. Do not forget to click on “Save Changes” afterward. Please note that the value fields expecting some number value in seconds.

Cache

Cache Mobile

Turn this option OFF when your website doesn’t have either AMP or mobile-specific design/content. For responsive websites turning this option ON is not necessary.

NB! This setting will edit the .htaccess file.

LiteSpeed Setting Off

TipsFor all other settings, you can easily use the default values. Probably you never need to change those values, because they work already the best optimum way for you. Do not forget to click on “Save Changes” when you have changed any of the toggles.

Purge

Purge All On Upgrade

Turn this option ON to have LiteSpeed Cache updated automatically, whenever a new version is released. However, it is strongly recommended to turn this OFF and apply updates manually.

LiteSpeed Setting On

Auto Purge Rules for Publish/Update

I strongly do recommend to tick “All pages” option to make sure that nothing isn’t cached when content has updated. Usually, it’s a good practice to purge only pages where the content has changed. On the other hand, people tend to forget such a rule like “Auto Purge“. That’s why the safest bet is to choose purge all option. Make sure you know what are you doing when choosing another way.

LiteSpeed Purge All

Scheduled Purge URLs

If you have content that is generated by an outside source at a certain time every day, then you might want to purge the page to be sure the outside content is correctly displayed. You can specify a list of URLs (one per line) that will be purged automatically at a certain time of day.

NB! Specifying those URLs is not necessary under normal circumstances.

1. line: https://yourdomain/events/list.php
2. line: /events/list.php

TipsNote that the second URL points to the same URL as the first one.

Scheduled Purge Time

Here you can specify the purge time when you have fulfilled “Scheduled Purge URLs” field.

10:00 PM

Excludes

Force Cache URIs

You can specify special URIs to force caching regardless of any “non-cacheable” settings that may appear elsewhere. Also, you can overwrite default TTL value when the current value doesn’t satisfy your needs.

NB! You can use special characters “^” and “$“, to indicate the beginning of a string and/or the end of a string e.g. ^/events/list/$.

1. line: /events/list/?category=online 300
2. line: /events/list/?category=classes 600
3. line: /events/list/$

TipsNote that by default events page will use default TTL caching period. Although, online and classes category will use accordingly 300 and 600 seconds of caching period.

Do Not Cache URIs

You can specify your own URIs to skip caching regardless of any “cacheable” settings that may appear elsewhere.

NB! You can’t use TTL values at the end of URI strings here because this is for caching only.

1. line: /events/list/
2. line: /events/list/$
3. line: ^/events/list

TipsYou can also use special characters “^” and “$” here. This setting is very useful when some REST API calls need to be excluded from the cache mechanism.

Do Not Cache Query Strings

The query string is the part of URI what stays on the right side from “?” symbol e.g. https://www.yourdomain.com/events/list/?category=online where the query string is category=online.

1. line: category

TipsYou don’t want to cache any pages where categories are used.

Do Not Cache Categories

To prevent categories from being cached you can exclude any by entering particular category slug value for this setting. Example https://www.yourdomain.com/category/{category-slug}/ e.g. review.

1. line: category-slug
2. line: category-slug-2

TipsYou can insert multiple category slugs, one per line.

Do Not Cache Tags

To prevent tags from being cached you can exclude any by entering particular tag slug value for this setting. Example https://www.yourdomain.com/tag/{tag-slug}/ e.g. wordpress.

1. line: tag-slug
2. line: tag-slug-2

TipsYou can insert multiple tag slugs, one per line.

Do Not Cache Cookies

This is a list of cookies telling that, do not cache any page where a cookie in this list appears in the request headers. In normal circumstances, you don’t need to use that option.

NB! This setting will edit the .htaccess file.

1. line: yummy_cookie

TipsYou can insert multiple cookies, one per line. Spaces should have a backslash in front of them,\

Do Not Cache User Agents

When a visitor requests a page from your site via one of the listed user agents, they will not be served from the cache. In normal circumstances, you don’t need to use that option.

NB! This setting will edit the .htaccess file.

1. line: Mozilla/5.0

TipsYou can insert multiple user agents, one per line. Spaces should have a backslash in front of them,\

Do Not Cache Roles

When you are an administrator, testing new functionality, you may want to exclude yourself from being served from cache until your testing is done.

LiteSpeed Administrator Role

 

A2 Hosting Speed Banner

 

 

A2 Hosting servers are located around the globe in the US, UK, Canada, Brazil, France, Germany, Australia, India, etc.

* Technologies used by BestCloudTools website