X-Nextjs-Cache
The HTTP X-Nextjs-Cache response header is an unofficial header added by Next.js to indicate the cache status of a statically generated or incrementally regenerated page.
Note
The "X-" naming convention for HTTP headers, "X" referring to "experimental", has been deprecated and needs to be transitioned to the formal naming convention for HTTP headers.
Usage
Next.js adds the X-Nextjs-Cache header to responses served from the Full Route Cache. The header appears on pages built with Static Site Generation (SSG) or Incremental Static Regeneration (ISR), where the framework pre-renders pages and serves them from cache.
The value reveals whether a page was served from cache, freshly generated, or served stale while a background revalidation takes place. This makes the header a quick diagnostic signal for verifying Caching behavior in Next.js applications, especially when paired with X-Vercel-Cache on Vercel-hosted deployments.
Values
HIT
The HIT value means the page was found in the
Next.js cache and served directly without
regeneration. This is the expected result for
statically generated pages after the first request.
MISS
The MISS value means the page was not in the
cache. The server rendered the page on demand and
stored the result for subsequent requests. A MISS
is typical for the first request to a page after a
build, a redeployment, or a cache eviction.
STALE
The STALE value means the cached page has passed
its revalidation window. Next.js served the
existing cached version to keep response times fast
while triggering a background regeneration. The
next request after the regeneration completes
receives the updated page. This is the
stale-while-revalidate pattern used by ISR.
REVALIDATED
The REVALIDATED value means the page was
regenerated in the background and the cache entry
has been updated. The response contains the freshly
rendered content following a successful
revalidation cycle.
Example
A HIT means the page was already cached and
served without regeneration. This is common for
statically generated product pages, blog posts, and
marketing content built at deploy time.
X-Nextjs-Cache: HIT
A MISS means the page was not in cache and had to
be rendered on demand. This occurs on first visits
after deployment or when a page path has not been
pre-rendered.
X-Nextjs-Cache: MISS
A STALE means the cached version exceeded its
revalidate interval. Next.js served the older
version immediately and started regenerating the
page in the background for the next visitor.
X-Nextjs-Cache: STALE
On Vercel deployments, the X-Nextjs-Cache header often appears alongside X-Vercel-Cache and X-Vercel-Id, giving a full picture of both the application-level and CDN-level cache behavior.
X-Nextjs-Cache: HIT
X-Vercel-Cache: HIT
X-Vercel-Id: iad1::abcde-1234567890123-abcdef123456
Takeaway
The X-Nextjs-Cache response header reports whether a Next.js page was served from the application cache, rendered fresh, or served stale during background revalidation.