Insights

X-LiteSpeed-Cache Always Shows miss? Check Cookies and Cache Rules First

November 9, 2026
0:00
You turn on LSCache, purge everything, reload the page, and the response headers say X-LiteSpeed-Cache: miss. You reload again. Still miss. The page takes just as long as before. In most of these cases the cache engine is fine. Something in the request or the response is telling LiteSpeed not to store the page, or not to serve the stored copy, and the usual culprits are cookies, query strings, and exclusion rules. This walkthrough goes from the header you can see down to the setting that causes it, and clears out the false alarms along the way.
LiteSpeed's page cache stores a full rendered copy of a page, so a hit is served without running PHP or touching the database. That is a different layer from an object cache like Redis, which only caches database query results inside PHP. If you are mixing the two up, the Redis object cache article covers that side. The header values mean roughly this:
  • hit means the response came from the public cache.
  • hit,private means it came from a per-visitor private cache.
  • miss means no cached copy existed for that exact request, so PHP built the page. If the page was cacheable, it gets stored for the next visitor.
If X-LiteSpeed-Cache is missing entirely, the request never went through a cache lookup. That points to the server or .htaccess side, covered further down. One miss is not a problem. The first request after a purge is always a miss, because that request is what fills the cache. The real symptom is a miss on the second identical request. The second header worth reading is X-LiteSpeed-Cache-Control. On WordPress, the LiteSpeed Cache plugin uses it to tell the server how to treat the response. A value like public,max-age=... means the plugin considers the page cacheable. no-cache means the plugin decided this page should not be cached. That is your strongest clue, because it moves the question from 'is the cache broken' to 'why did the plugin refuse this page'. The cleanest test is the same URL requested twice from the command line, with no cookies:
BASH
# Fetch the same URL twice with GET (not HEAD), discard the body, print cache-related headers
for i in 1 2; do
  curl -s -o /dev/null -D - 'https://example.com/' | grep -i -E 'x-litespeed|set-cookie|cache-control'
  echo '---'
done
A healthy result looks like this. Header names may be lowercase over HTTP/2.
TEXT
# Illustrative output format
x-litespeed-cache-control: public,max-age=604800
x-litespeed-cache: miss
---
x-litespeed-cache-control: public,max-age=604800
x-litespeed-cache: hit
If the second block says hit, the cache works for anonymous visitors, and whatever you saw in the browser comes from your own session. If it still says miss, or you see no-cache or a set-cookie line, keep reading.
The most common false alarm is testing while logged in to wp-admin. By default the plugin does not serve the public cache to logged-in users, because those pages can show the admin bar, drafts, or account details. A logged-in browser can show miss or no-cache forever, and nothing is wrong. On the support desk, 'are you logged in while testing?' is usually the first question, and the curl test above sidesteps it completely. A few more things look like cache failures but are not:
  • Adding something like ?test=1 to bust the browser cache creates a new cache entry, so the first request is a miss by design.
  • POST requests, such as form submissions, are not served from the page cache.
  • If a CDN sits in front of the site, its own cache status header describes a separate layer. A CDN hit and a LiteSpeed miss can both be true at once. Read each header for what it describes.
  • Mobile caching, when enabled, keeps a separate copy for mobile visitors. A desktop hit does not warm the mobile copy.
If curl shows a hit on the second request but a private browser window keeps missing, that is useful too. It means the browser is sending something curl is not, which is almost always a cookie.
Cookies break caching in two directions, and it helps to separate them. The first is cookies the visitor sends. WordPress sets a wordpress_logged_in_* cookie for logged-in users and comment_author_* cookies for people who have left a comment. WooCommerce sets cart and session cookies such as woocommerce_items_in_cart and wp_woocommerce_session_* once someone adds a product. The plugin treats these as signals that the visitor may need personalized content, so it either varies the cache or skips it. That is correct behavior. A shopper with items in the cart should not see a cached page with someone else's cart. The trouble starts when a cookie that every visitor carries gets listed under the plugin's cookie exclusions (in recent versions, Cache > Excludes > Do Not Cache Cookies). If a consent banner or analytics script sets a cookie on every first visit and that cookie name is in the list, nobody gets a cached page except bots and curl. This explains the 'curl hits, browser misses' pattern. To confirm, copy the Cookie header from your browser's developer tools into curl with -H 'Cookie: ...', then remove cookies one at a time until the hit comes back. The second direction is cookies the response sets. Look for set-cookie in the curl output for an anonymous visitor. A response that sets a cookie is personal to that visitor, so the cache typically refuses to store it. A frequent cause is a plugin that starts a PHP session on every page load. That sends a PHPSESSID cookie along with no-store and no-cache headers, and the page never becomes cacheable. The fix is to find which plugin does it, usually by deactivating plugins one by one on a staging copy, and then configure or replace it. Stripping the cookie at the server level is tempting, but the plugin might depend on that session to work.
The cache key includes the query string, so /pricing/ and /pricing/?utm_source=newsletter are two different cache entries. Marketing traffic is full of tracking parameters like utm_*, gclid, and fbclid, often with a unique value per click. Every one of those visits looks like a brand-new URL, so it misses, even when the plain URL is fully cached. The plugin has a Drop Query String setting for exactly this case. Parameters listed there are ignored when building the cache key, so tagged links land on the same cached copy. Recent versions ship with some common tracking parameters already listed, but check what your installed version has rather than assuming. The rule for deciding what is safe to drop is simple. A parameter is safe if it never changes what the page renders. Tracking and attribution parameters usually fit, because the analytics script in the browser still reads them from the URL. Parameters that change content are not safe: pagination, search terms like s, product filters, sorting, currency, and language switches. Drop one of those and visitors start getting the wrong page from cache, which is far worse than a miss. Also check the opposite list, Do Not Cache Query Strings. A broad entry there can quietly exclude more than intended.
If the header says miss with no cookies and no query string, look at the rest of the exclusion settings. The URI exclusion list is the one most often misconfigured. A pattern meant to exclude a single checkout path can be written so broadly that it matches every URL on the site. Role, category, tag, and user agent exclusions can have the same effect on a smaller scale. Read each entry and ask what it actually matches, not what it was meant to match. When X-LiteSpeed-Cache does not appear at all, look below the plugin. The plugin normally writes a block into the site's .htaccess that switches on cache lookup. Migrations, restores, and security plugins that rewrite .htaccess sometimes drop that block.
BASH
# Read-only check: is the LSCache block and CacheLookup still in .htaccess? Adjust the path to your docroot
grep -n -i -E 'lscache|cachelookup' ~/public_html/.htaccess
No match usually means the plugin's rules are gone, and saving the cache settings again in the plugin typically rewrites them. If .htaccess changes seem to be ignored entirely, that is a separate issue, covered in the AllowOverride article. Beyond that, the cache has to be enabled for the virtual host in the server's LiteSpeed configuration. On shared hosting that is the host's side. Ask support to confirm it rather than guessing.
Change one thing at a time, purge the cache, and run the curl loop again. The pattern to look for is miss on the first request and hit on the second. Then repeat the test with your real browser cookies, and with a tagged URL if you changed query string handling, so you know real visitors benefit and not just curl. If the cause is still unclear, the plugin's debug log (under Toolbox > Debug Settings in recent versions) can record why a page was marked uncacheable. Turn it on, make a few requests, read the log, and turn it off again. It grows quickly and can capture request details you would not want left on disk. Where it writes the log depends on the plugin version. The short version: a repeated miss is almost always a decision, not a malfunction. Read X-LiteSpeed-Cache-Control, check for set-cookie, compare a cookie-less curl request with a real browser, and only relax a rule once you are sure that cookie or parameter does not change what the page shows.

Join My Newsletter & Get Updates!

Get notified whenever a new technical guide, server infrastructure breakdown, or personal reflection goes live, plus a curated weekly digest.