Skip to main content
sitewarm
HTTP caching headers

What is the Cache-Status header?

Cache-Status, defined in RFC 9211, is a standard response header in which each cache on the path reports whether it served a hit and why.

Cache-Status is a standard HTTP response header, defined in RFC 9211, in which each cache that handled a request adds an entry saying how it handled it. Entries are ordered from the origin side to the client side, and parameters say whether it was a hit, why it forwarded the request, and how much freshness was left.

Cache-Status: OriginShield; fwd=uri-miss; stored, EdgeCache; hit; ttl=376

The parameters RFC 9211 defines are:

  • hit: the response came from the cache without contacting the next hop.
  • fwd: why the request was forwarded, such as uri-miss, vary-miss, stale or bypass. fwd-status is the status the next hop returned.
  • ttl: freshness left in seconds. A negative value means a stale hit.
  • stored: whether the forwarded response was stored. collapsed: whether the request was collapsed with others.
  • key and detail: implementation-specific details.

Many CDNs still use their own headers, such as cf-cache-status, x-cache or x-vercel-cache, each with its own values. Reading them consistently is what tells you whether a page is a hit or a miss, and whether cache warming worked. Tiered caches show up as several entries.

Each CDN reports cache state differently. The Top 10 CDNs comparison scores ten of them on it, and the guides for Cloudflare, Netlify and Akamai show how to read their headers.

References

  1. RFC 9211: The Cache-Status HTTP Response Header Fieldhttps://www.rfc-editor.org/rfc/rfc9211
  2. Cloudflare: Cache responseshttps://developers.cloudflare.com/cache/concepts/cache-responses/
  3. Fastly: X-Cachehttps://www.fastly.com/documentation/reference/http/http-headers/X-Cache/

Warm your cache after every deploy

sitewarm requests the pages in your sitemap after a deploy and reports the cache state the CDN returns for each one, with the vantage point it was measured from.