Skip to content

Headers ​

Emitted on cacheable responses ​

The cache headers depend on the CDN driver (defaults: revalidate = 3600, expire = one year, stale_if_error = 604800):

HeaderExampleDriver
Cache-Controlpublic, max-age=0, must-revalidateevery driver except CloudFront (browsers)
Cache-Controlpublic, max-age=0, s-maxage=3600cloudfront (stale: true adds stale-while-revalidate / stale-if-error)
CDN-Cache-Controlpublic, max-age=3600, stale-while-revalidate=31532400, stale-if-error=604800null, bunny
Cloudflare-CDN-Cache-Controlsamecloudflare
Surrogate-Controlmax-age=3600, stale-while-revalidate=31532400, stale-if-error=604800fastly, varnish
X-Accel-Expires3600nginx
Cache-Tagposts,post:42,_IST_/,_IST_/blog/,…cloudflare
Surrogate-Keyposts post:42 _IST_/ _IST_/blog/ …fastly
xkey (tag_header)posts post:42 _IST_/ _IST_/blog/ …varnish
CDN-Tagposts (first tag only)bunny with native_tags: true
ETag"9f2c0d…" (strong)every 200; If-None-Match → 304
X-Inertia-Static-Cachecacheableyour CDN rules
X-Inertia-StaticMISSdebugging

The multi driver emits the headers of every driver it chains. Tags are the route and response tags plus the implicit path tags.

X-Inertia-Static: MISS is set by the origin when it renders a cacheable response; the CDN stores and replays it. For the CDN state, read the CDN's own header (CF-Cache-Status, X-Cache, X-Cache-Status…).

Emitted on non-cacheable responses of static routes ​

http
Cache-Control: no-store, private
X-Inertia-Static-Cache: bypass
X-Inertia-Static-Reason: authorization

The CDN headers (*-Cache-Control, Surrogate-*, tag headers, X-Accel-Expires) are removed, and there is no X-Inertia-Static header.

X-Inertia-Static-ReasonCause
authorizationthe request has an Authorization header
previewa valid preview cookie was sent
livethe never-cached live JSON URL
leak:auth, leak:session, leak:cookie, leak:headerthe leak detector fired (log / auto mode)
server-errorstatus ≥ 500
partial-reloadpartial reload, deferred props or X-Inertia-Reset
inertia-json-on-html-urlan Inertia visit (X-Inertia) on the HTML URL
redirecta redirect from your code, with defaults.cache_redirects off, or any redirect on the page JSON URL
status:404-jsona 404 asked as JSON (Accept: application/json) on the HTML URL
status:<code>any status other than 200, 404 or a redirect (e.g. status:409 after a deploy)
ssr-unavailablewith ssr.required on: SSR is enabled but the HTML was rendered without it
not-staticthe page JSON URL of an unknown or dynamic route (404)

The header names follow cache_header and debug_header ({debug_header}-Reason); an empty value disables them.

Removed ​

HeaderWhy
Set-Cookiea shared cache must never store or replay a cookie
Cookie in Vary
X-Inertia in Vary (page JSON URLs only)the URL already identifies the representation
X-Inertia-Devtools-*per-request ids (Inertia DevTools is disabled on static routes)

Request headers that matter ​

HeaderEffect
Authorizationnever cached (authorization)
Cookieremoved before routing on static routes (except the live URL)
X-Forwarded-Host, X-Forwarded-Port, X-Forwarded-Prefix, Forwardedremoved on static routes
X-Forwarded-Protoset to the scheme of the base URL on static routes
If-None-Match304 when it matches
X-Inertia on the HTML URLnot cached (inertia-json-on-html-url)
X-Inertia-Partial-*, X-Inertia-Resetpartial reload: not cached; the client sends these visits to the live URL
Other X-Inertia-* request headers (Except-Once-Props, Infinite-Scroll-Merge-Intent, …)ignored on a page load (no X-Inertia) of the HTML URL
X-Inertia-Static-Bypassset on a visit, it makes the client plugin send it to the live URL
Cache-Control: no-cache (router.reload(), polling)the client plugin sends the visit to the live URL

Released under the MIT License.