litespeed/update-cache-vary changes the cookies and groups that make LiteSpeed keep a separate cached copy of a page.
Read litespeed/get-cache-vary first, and change one thing at a time.
At a glance
| Ability | litespeed/update-cache-vary |
| Toolset | LiteSpeed Cache — toolset/litespeed |
| Group | LiteSpeed Cache › Page Cache |
| Requires | LiteSpeed Cache, active on the site |
| Capability | manage_options |
| Safety | Writes data |
| Repeatable | Idempotent — running it twice leaves the same result |
| Ships in | AcrossAI Abilities Manager 0.0.34 and later |
One change, then test
A vary rule decides when LiteSpeed keeps a separate cached copy of a page. Get it wrong and one visitor’s page is served to another — a logged-in user’s dashboard to a stranger, one customer’s cart to the next. That failure does not announce itself; it shows up as a support message from somebody who saw a name that was not theirs.
The advice to change one thing at a time is not caution for its own sake. Vary rules interact: adding a cookie that is already covered by a group does nothing, removing one that a plugin depends on breaks that plugin only for cached visitors, and the symptoms of both are identical from the outside.
After any change, purge and then test with two different sessions — two browsers, or one browser and one private window. A single session cannot demonstrate that copies are being kept apart, because there is only one copy to see.
Adding a vary dimension multiplies the number of cached copies. A rule that splits on a cookie with many values can turn a small cache into a very large one, and the hit rate falls accordingly.
The write is a patch, not a replacement. Send one key and one key changes; everything else in the area is left alone. The response names the keys that actually moved, so a payload that matched the existing values comes back with an empty list rather than a misleading success.
Input
| Name | Type | Required | What it is |
|---|---|---|---|
settings | object | Yes | A map of setting key to new value. Keys outside this area are refused, and the refusal lists what the area accepts. |
What comes back
| Name | Type | What it is |
|---|---|---|
updated | array | The keys that actually changed. An empty array means every value you sent was already set. |
settings | array | Every setting in the area after the write, in the read shape. |
success | boolean | Whether the call completed. |
message | string | A one-line summary of what happened, suitable for showing a human. |
error_code | string | Present only on failure — a stable machine-readable reason, such as a missing field, a wrong field type or an unmet confirmation. |
Example
Ask your assistant:
Add our currency cookie to the vary rules.
It resolves to one call:
{
"ability": "litespeed/update-cache-vary",
"parameters": {
"settings": { "cache-vary_cookies": ["site_currency"] }
}
}Worth knowing
- Purge after changing vary rules. Existing entries were keyed under the old ones.
- Test with two separate sessions. One proves nothing.
- Every vary dimension multiplies the number of cached copies.
- Change one rule at a time.
Related abilities
- Get Cache Vary Rules — read before writing
- Purge Cache — required after a vary change
Get the plugins:
AcrossAI Abilities Manager · AcrossAI MCP Manager
Browse the rest: Every ability, by category