This is an old revision of the document!
LiteSpeed Cache for WordPress Settings: Excludes
Force Cache URIs
empty string
Paths containing the listed strings WILL be cached, regardless of any “non-cacheable” settings that may appear elsewhere. One per line. Each string will be compared to the REQUEST_URI server variable. If there is a match, the URI will be cached. To indicate the beginning of a string, add ^
to the beginning of the string. To do an exact match, add $
to the end of the string.
String Matching Examples
Assume you have the following URIs:
/recipes/baking/
/recipes/baking/cakes
/recipes/baking/brownies
/popular/recipes/baking/
The string /recipes/baking/
will match all four URIs.
The string /recipes/baking/$
will match #1 (because $
indicates exact match).
The string ^/recipes/baking
will match #1, #2, and #3 (because ^
indicates the beginning of the URI).
Do Not Cache URIs
empty string
Paths containing the listed strings will not be cached. One per line. Each string will be compared to the REQUEST_URI server variable. If there is a match, the URI will not be cached. To indicate the beginning of a string, add ^
to the beginning of the string. To do an exact match, add $
to the end of the string. (See the Force Cache URIs setting above for examples of how the string matching works.)
Do Not Cache Query Strings
empty string
You can eliminate URLs with certain query strings from being cached. For example, if you don't want to cache any page that is rendered in a purple color scheme, you could enter color=purple
in that list (assuming the URL you use to indicate that a page should be purple looks like http://example.com/page?color=purple
). You could also enter color
to indicate that you don't want to cache any URL where color is specified, regardless of which color it is.
Do Not Cache Categories
empty string
By default all categories are cached. If you have categories that you wish to exclude from the cache, enter a list of the category slugs (one per line) in this box.
EXAMPLE: To exclude http://www.example.com/category/category-slug/
, insert category-slug
.
NOTE: If the category slug is not found, the category will be removed from the list on save.
Do Not Cache Tags
empty string
Tags are treated the same way as categories: cached by default, but ignored if entered by slug (one per line) in this box.
Do Not Cache Cookies
empty string
This is a list of cookies that should not be cached. Specifically, do not cache any page where a cookie in this list appears in the request headers.
This option can be more far-reaching than you may realize. If you exclude a cookie that exists on every page of your site, then you are essentially excluding your entire site from being cached.
Do Not Cache User Agents
empty string
Specific user agents may also be excluded from cache. This means that if a visitor requests a page from your site via one of the listed user agents, they will not be served from the cache. You can enter user agents by name in this box, one per line.
NOTE: Partial matches are allowed.
Do Not Cache Roles
unchecked
There may be user roles that you wish to exclude from caching. For example, if you are an admin, testing new functionality, you may want to exclude your administrator
role from being served from cache until your testing is through.