Skip to main content

Response Headers

PRISM adds several headers to HTTP responses to indicate rendering status, cache state, and variant information. These headers are useful for debugging, CDN cache keying, and monitoring.

PRISM strips any x-prism-* headers from origin responses before adding its own, preventing origin-side forgery.

Rendered Responses​

These headers appear on responses that were rendered through the Chrome pipeline:

x-prism-rendered​

x-prism-rendered: true

Present on every response that was rendered by PRISM via headless Chrome. Absent on proxied (bypass) responses.

x-prism-cache​

x-prism-cache: HIT|MISS|STALE|BYPASS

Indicates the cache status of the response:

ValueMeaning
HITServed from the render cache
MISSFreshly rendered and now cached
STALEServed stale from cache while re-rendering in the background, or, with cache.stale_if_error_secs set, served from an expired copy because a fresh render failed
BYPASSNot rendered; proxied directly to origin

This header is present on all responses, including bypass responses.

STALE requires that serving stale is permitted. An origin that sent must-revalidate, proxy-revalidate or s-maxage has forbidden it — s-maxage carries proxy-revalidate semantics for shared caches (RFC 9111 §5.2.2.10) — so entries carrying those expire outright rather than entering the grace window configured by cache.grace_period_secs.

With cache.stale_if_error_secs above 0, a STALE response can also mean that a fresh render failed, was refused for capacity, or met an origin error, and that PRISM answered from the copy it holds of the page instead. That copy expired no longer ago than the setting allows, is sent with the status it was stored with, and no re-render is triggered by serving it.

Cache-Status​

Cache-Status: prism; hit

The same fact as x-prism-cache, in the interoperable field RFC 9211 defines, so a CDN, a browser devtools pane or an engineer reading someone else's stack can see it without knowing PRISM exists. Both are sent; x-prism-cache predates the standard and deployments read it, so it is not going anywhere.

SituationCache-Status
served from cacheprism; hit
served stale while re-rendering, or because a fresh render failedprism; hit; detail=stale
rendered because nothing was storedprism; fwd=miss
not rendered at allprism; fwd=bypass

Stale is reported as a qualified hit rather than fwd=stale, because the reader was answered from the cache — forwarding is precisely what serving stale avoids.

There is no ttl parameter. RFC 9211 makes every parameter optional, and the remaining freshness is derivable from the Age and Cache-Control sent alongside it. A third statement of the same number would be one more thing that can disagree with the other two.

ETag​

ETag: W/"3f2a9c1b7d04e856"

Every rendered 200 carries a weak ETag: a 64-bit hash of the HTML that is served, hex-encoded. The same body gets the same tag on the first render and on every cache hit, gzipped or not, and the tag changes when the HTML does. PRISM computes it once when the page is stored, not on each hit. A different PRISM version may derive a different tag for the same body.

The origin's own ETag and Last-Modified describe the page before rendering and are never sent on a rendered response.

304 Not Modified​

A GET or HEAD for a rendered page that PRISM would answer 200, and that carries an If-None-Match naming the current ETag, is answered 304 Not Modified with no body. The comparison is the weak one: a list of tags, W/ prefixes and * are all handled. The 304 carries the ETag, the same Cache-Control and Vary, and the same X-Prism-* headers the 200 would have, and no Content-Length, Content-Encoding or Content-Type. If no tag matches, the response is the ordinary 200. Proxied visitors, fallbacks, redirects and error statuses are not affected, and a visitor's If-None-Match still reaches your origin untouched.

Retry-After​

When the origin answers the page request with an error status and a Retry-After header, PRISM passes the header on with that status, so a crawler is told when to come back. On a non-error status the origin's Retry-After is not sent. The Retry-After PRISM sends on its own 503 and 429 is unchanged.

x-prism-render-time​

x-prism-render-time: 1250

The time in milliseconds that the Chrome render took. Only present on cache MISS responses (fresh renders). Not included on HIT or STALE responses since no render occurred.

x-prism-variant​

x-prism-variant: bot-mobile|bot-desktop|human-mobile|human-desktop

The rendering variant used for this request. Determined by combining bot detection with device detection (when viewport-aware rendering is enabled):

VariantDescription
bot-mobileBot user-agent on a mobile viewport
bot-desktopBot user-agent on a desktop viewport
human-mobileHuman user on a mobile viewport
human-desktopHuman user on a desktop viewport

x-prism-fallback​

x-prism-fallback: true

Present when PRISM served the origin's own response instead of a render. The value says why:

ValueMeaning
trueThe render was attempted and failed — Chrome crash, timeout, content validation — so the origin's response was served instead. A reader always gets an answer even when the render pipeline is degraded.
not-htmlThe origin returned something that is not HTML on a route that renders — or an error status with no body at all, which Chrome cannot display. Nothing to render; it is passed through unchanged, status included.
no-transformThe origin sent Cache-Control: no-transform and cache.honor_no_transform is on. The render succeeded and was discarded: the directive forbids serving a transformed representation, not producing one.

| left-origin | The page's own JavaScript took the document to another origin (single sign-on, a geo redirect), so what Chrome held was not this site's page. Nothing was cached, and the origin's own response is served for the request. Exclude the route from rendering, or set server.public_base_url if the other origin is this site's public address. See Is it still the site's page?. |

The first is a degradation. The others are PRISM doing what it was told.

Two more values appear on PRISM's own 503, which is what a bot receives when a page cannot be rendered. A crawler is never handed the origin's unrendered page in that case — it would index the empty shell — so it is told to come back instead (Retry-After: 30):

ValueMeaning
capacityThere was no tab to render with: the queue is full, the circuit breaker is open, or Chrome is not up. In render-all mode a visitor in the same situation gets the origin's response, also marked capacity.
render-failedThe render was attempted and failed — timeout, navigation error, content validation.

Bypass / Unlicensed Responses​

x-prism-license​

x-prism-license: unlicensed

Present on bypass responses when PRISM is running without a valid license. Not present when properly licensed.

CDN Integration Headers​

Vary​

Vary: User-Agent, Accept-Encoding, Accept

Names the request headers that select between representations of a URL, merged with whatever the origin already declared and anything listed in [cache] vary.

User-Agent appears only when it can actually matter — in bot-only mode, where it decides whether a client is rendered or proxied, and when viewports are enabled. It is close to unique per client, so declaring it costs a downstream cache nearly every hit. Operators who want low-cardinality edge caching normalise the User-Agent into one header at the edge and list that header in [cache] vary; PRISM then keys on it and advertises it instead.

X-Prism-Variant is deliberately not listed here. Vary names request headers and nothing sends that one, so a cache looked it up, found it absent on every request, and collapsed every variant into a single object. Use it as a cache-key component instead — see CDN Integration.

Since 1.4.0 this is set on bypassed responses too, when the route is one that renders for somebody. A URL that renders for a crawler and is proxied to a person has two representations, and a downstream cache that stores the second without knowing what separates them will answer the first with it — on a request PRISM never sees and so cannot correct. Routes that never render declare nothing extra, so edge caching for assets and excluded paths is unaffected.

Age​

Age: 47

How many seconds old the response body is, counting time it spent in a cache upstream of PRISM before it arrived. Required of any cache reusing a stored response (RFC 9111 §4).

Without it a downstream CDN starts its own freshness clock from zero and the same seconds are counted on every hop. PRISM also reads the origin's Age: a response arriving with Age: 50 and max-age=60 has ten seconds of freshness left here, not sixty.

Time spent rendering is included, since 1.4.0. The entry's clock starts when it is stored, which is after the render, so the age it starts from accounts for the origin's Date, its Age, and however long the fetch and render took — RFC 9111 §4.2.3. Before that the render was granted for free: on the shipped 30-second error TTL, a five-second render was a sixth of the lifetime nobody had counted.

Cache-Control​

Cache-Control: private, max-age=3600

Synthesized by PRISM only when the origin response includes no Cache-Control of its own and cache.synthesize_cache_control is not false. What it says depends on that setting and on the server mode:

cache.synthesize_cache_controlbot-onlyrender-all
true (default)private, max-age=<ttl>public, max-age=<ttl>, s-maxage=<ttl>
"public"public, max-age=<ttl>, s-maxage=<ttl>same
"private"private, max-age=<ttl>same
falsenothing addednothing added

Earlier releases always produced the public form. In bot-only mode that invited a CDN which ignores Vary to store crawler HTML and serve it to visitors. See CDN integration.

The lifetime announced is the one PRISM actually stores under, which since 1.4.0 depends on what the response is:

responseannounced
an ordinary rendercache.default_ttl or the path-specific rule
a 5xx from the origincache.error_ttl_secs (default 30s), or no-store when that is 0
PRISM's own 429, 502, 503, 504no-store

Before 1.4.0 the route's TTL was announced in every case, so an error stored for thirty seconds was advertised for an hour and anything caching in front of PRISM kept serving it after the origin recovered. See status codes for what is stored and for how long.

When the origin does send one, it is preserved and — since 1.4.0 — obeyed. PRISM's cache is shared and cannot revalidate, so a directive requiring validation before reuse can only be honoured by not keeping the entry at all: no-cache, max-age=0, s-maxage=0 and Vary: * are all refused, alongside no-store and private. Where the origin does grant freshness it caps PRISM's own TTL rather than being overruled by it, s-maxage first.

Before 1.4.0 only no-store and private were read and everything else was forwarded to the client while PRISM itself ignored it. With cache.ignore_origin_no_cache PRISM keeps the render despite no-cache, max-age=0, s-maxage=0 and must-revalidate, and still forwards the origin's header unchanged. See Cache configuration.

Header Precedence​

PRISM preserves security and cache headers from the origin response (e.g., Strict-Transport-Security, X-Frame-Options, Content-Security-Policy) but does not override any header it has already set. Origin ETag and Last-Modified headers are not forwarded on rendered responses because the response body has been transformed; PRISM sends its own ETag instead.

Debugging with Headers​

Use curl -I to inspect PRISM headers without downloading the full response:

# Check if a page is being rendered
curl -sI https://example.com/products/widget | grep -i x-prism

# Expected output for a rendered bot request:
# x-prism-rendered: true
# x-prism-cache: HIT
# x-prism-variant: bot-desktop

To test as a bot:

curl -sI -A "Googlebot/2.1" https://example.com/products/widget | grep -i x-prism