Skip to main content

HTTP Status Code Propagation

PRISM captures and propagates HTTP status codes from the origin through the rendered response. For SPAs that handle routing client-side, PRISM also supports status code signaling from the application itself.

Default Behavior

PRISM captures the HTTP status code from Chrome's navigation response to the origin URL. If the origin returns a 404, PRISM's response to the bot is also a 404. If the status code cannot be captured (e.g., timeout), it defaults to 200.

SPA Status Override

SPAs typically return HTTP 200 for every route because the server delivers the same index.html shell regardless of the path. Client-side routing then renders the appropriate content. This means a SPA's "Not Found" page still returns a 200 status, which confuses search engines.

Enable status_from_meta to let your SPA signal the correct status code:

[render]
status_from_meta = true

PRISM checks three sources in priority order:

1. JavaScript Global (Highest Priority)

Set window.__PRISM_STATUS__ to a numeric HTTP status code in your SPA:

// In your 404 route component
window.__PRISM_STATUS__ = 404;

PRISM evaluates this after rendering completes. It takes precedence over all other signals.

2. Meta Tag

Add a meta tag to the rendered <head>:

<meta name="render:status_code" content="404">

or the alternate form:

<meta name="prism:status" content="404">

Both tag names are supported. With React Helmet, this is straightforward:

import { Helmet } from 'react-helmet';

function NotFoundPage() {
return (
<>
<Helmet>
<title>Page Not Found</title>
<meta name="render:status_code" content="404" />
</Helmet>
<h1>404 - Page Not Found</h1>
</>
);
}

3. Navigation Response (Lowest Priority)

The HTTP status code captured from Chrome's navigation to the origin URL. This is the default fallback when no SPA signals are present.

Common Status Code Use Cases

StatusUse Case
200Normal page
301Permanent redirect (signal via meta tag for SPA soft redirects)
404Page not found
410Permanently removed content
503Temporary maintenance page

Error TTL for 5xx Responses

When the final status code is 500 or higher, PRISM uses the cache.error_ttl_secs setting instead of the normal TTL:

[cache]
error_ttl_secs = 60 # Cache 5xx responses for 60 seconds

Set to 0 to skip caching 5xx responses entirely (the default behavior if not configured). This prevents a temporary server error from being cached and served to bots for the full default TTL.