Customer deployed changes, refreshed the page, still sees old content. They open a ticket saying "the site didn't update." Before you purge every cache in sight, spend thirty seconds with curl. Three response headers — Age, X-Cache (or its CDN-specific equivalent), and Cache-Control — tell you exactly which layer is holding the stale copy.
This guide is entirely CLI-based. No browser DevTools, no control panel clicking. Just curl, the headers, and a clear read of what they mean.
Grab the headers without downloading the body
Use curl -sI to fetch only response headers. The -s flag silences the progress bar, -I sends a HEAD request.
curl -sI https://example.com/landing-page | grep -iE 'age:|x-cache|cache-control|cf-cache-status|x-varnish|x-litespeed-cache'
That one line gives you the three (or four) headers you need. Run it a few times in a row — the values changing between requests tells you something different than the values staying the same.
A note on HEAD vs GET: some servers and CDNs treat HEAD requests differently from GET requests when it comes to caching. If the headers look suspicious or missing, try curl -s -o /dev/null -D - with a full GET instead, which downloads the body (discards it to /dev/null) but prints all response headers.
What each header tells you
Cache-Control is the directive. It tells every cache in the chain — browser, CDN edge, reverse proxy — how long they are allowed to keep a copy and under what conditions. Common values you will see:
max-age=3600means "this response can be served from cache for 3600 seconds (one hour) without asking the origin again."no-cachedoes not mean "don't cache." It means "cache it, but revalidate with the origin before serving." This trips people up constantly.no-storemeans "don't cache this at all." This is the one that actually prevents caching.s-maxage=600overridesmax-agebut only for shared caches (CDNs, reverse proxies). Browsers ignore it.publicvsprivate:publicallows shared caches to store it;privaterestricts caching to the end user's browser only.
If Cache-Control says max-age=86400 and the deploy happened ten minutes ago, every cache layer is within its rights to serve the old version for up to 24 hours. That is not a bug. That is the header doing what it was told.
Age is the clock. It is a single integer representing how many seconds ago the cached copy was stored by the intermediate cache (typically the CDN or reverse proxy). If Age: 7200 and Cache-Control: max-age=3600, the object is already past its freshness lifetime — the cache should have revalidated. If Age: 120 and max-age=3600, the cached copy is still fresh and will keep being served for another 3480 seconds.
When Age is absent, it usually means either the response came directly from the origin (no intermediate cache involved) or the cache does not add the header.
X-Cache (and its variants) is the verdict. It tells you whether the cache served a stored copy or went back to the origin. The exact header name and values depend on the caching layer:
- Varnish typically uses
X-Cache: HITorX-Cache: MISS. - AWS CloudFront uses
X-Cache: Hit from cloudfrontorX-Cache: Miss from cloudfront. - Cloudflare uses
cf-cache-statuswith values likeHIT,MISS,EXPIRED,DYNAMIC,BYPASS. - LiteSpeed web server uses
X-LiteSpeed-Cache: hitormiss. If you run LiteSpeed, the related article on verifying LSCache headers covers this in detail.
A HIT means the response came from cache, not from your origin server. A MISS means the cache went to the origin, fetched a fresh copy, and (depending on the Cache-Control directives) stored it for next time.
Reading the headers together: which layer is stale?
The headers only make sense when you read them as a group. Here is how to reason through the common scenarios.
Scenario 1: CDN is serving old content.
You see X-Cache: HIT (or cf-cache-status: HIT), Age: 14400, and Cache-Control: max-age=86400. The CDN cached the page four hours ago and considers it fresh for another twenty hours. Your deploy changed the file on the origin, but the CDN has no reason to check. Fix: purge the specific URL (or path pattern) in the CDN, or wait for max-age to expire. Lowering max-age for future deploys prevents this from recurring.
Scenario 2: Server-side cache (Varnish, LiteSpeed, Nginx fastcgi_cache) is stale.
You see X-Cache: HIT but Age is low (say, Age: 5), and you are not using a CDN — or the CDN reports MISS. The reverse proxy or web server cache on your own box is serving the old page. Restart or purge that specific cache. For Varnish, that is typically varnishadm 'ban req.url ~ /landing-page'. For LiteSpeed with LSCache, purge through the WordPress plugin or the server-level purge mechanism.
Scenario 3: No cache is involved — the old file is actually on disk.
You see X-Cache: MISS (or no X-Cache header at all), Age is absent, and Cache-Control says no-store or no-cache. The response is coming straight from the origin. If the customer still sees old content, the deploy itself may not have landed. Check whether the files on disk actually changed: compare timestamps, checksums, or git log on the server. Also check whether the server has multiple document roots or the domain resolves to a different server than expected — the article on checking AAAA records after migration covers one common variant of this.
Scenario 4: Browser cache.
You run curl and see MISS with fresh content, but the customer insists they see the old page. curl does not use a browser cache. The customer's browser is serving from its local cache based on a previous Cache-Control: max-age=... header. Ask them to hard-refresh (Ctrl+Shift+R on most browsers) or open an incognito/private window. If that fixes it, the problem was browser-side all along. For future deploys, consider cache-busting query strings or hashed filenames for static assets.
A quick before-and-after pattern
When a customer reports stale content, run the curl command once before you do anything. Save the output. Then perform your purge or fix. Run it again. Compare.
# Before purge
curl -sI https://example.com/landing-page | grep -iE 'age:|x-cache|cache-control|cf-cache-status|x-litespeed-cache|last-modified|etag'
# ... perform purge or deploy fix ...
# After purge
curl -sI https://example.com/landing-page | grep -iE 'age:|x-cache|cache-control|cf-cache-status|x-litespeed-cache|last-modified|etag'
Including Last-Modified and ETag in the grep gives you extra confirmation. If Last-Modified still shows yesterday's date after your deploy, the origin file has not changed — or the cache is still serving the old copy. If ETag changes between the before and after, you know the origin is now serving new content.
When Age drops to 0 and X-Cache flips from HIT to MISS after your purge, the CDN fetched a fresh copy. Run it once more a few seconds later — Age should be a small number and X-Cache should be HIT again, now with the new content.
When Cache-Control is missing or wrong
Sometimes the origin sends no Cache-Control header at all. In that case, caches are allowed to use heuristic expiration — typically a fraction of the time since Last-Modified. This is defined in RFC 7234 (now superseded by RFC 9111, which carries the same logic). Heuristic caching is why a page with Last-Modified set six months ago might get cached for days or weeks even without an explicit max-age.
If you see no Cache-Control in the response and the CDN is caching aggressively, the fix is to set explicit headers on the origin. How you do that depends on the web server:
- Apache:
Header set Cache-Control "max-age=300, public"in.htaccessor the vhost config. - Nginx:
add_header Cache-Control "max-age=300, public";in the location block. - LiteSpeed: respects
.htaccessdirectives similar to Apache.
For pages that change on every deploy (HTML), a short max-age (or no-cache) makes sense. For static assets with hashed filenames (like app.a3f9c2.js), a long max-age is fine because the filename itself changes on deploy.
The practical takeaway
Before purging anything, run curl -sI and read three headers. Cache-Control tells you the rules. Age tells you how old the cached copy is. X-Cache (or its CDN-specific variant) tells you whether a cache served it or the origin did. Together, they point you to the exact layer holding stale content — CDN edge, server-side cache, or the origin itself — so you fix the right thing instead of purging everything and hoping.