• 1 min read Vercel CDN now supports the stale-if-error directive with Cache-Control headers, enabling more resilient caching behavior during origin failures. • You can now use the stale-if-error directive to specify how long (in seconds) a stale cached response can still be served if a request to the origin fails. • When this directive is present and the origin returns an error, the CDN may serve a previously cached response instead of returning the error to the client. • Stale responses may be served for errors like 500 Internal Server Errors, network failures, or DNS errors. • This allows applications to remain available and respond gracefully when upstream services are temporarily unavailable. • Read the stale-if-error documentation to learn more.

Article Summaries:

  • Vercel’s CDN has added full support for the stale-if-error directive in Cache‑Control headers, allowing sites to serve stale content when the origin fails. The directive lets developers set a time window (in seconds) during which a previously cached response may be returned if a request to the origin results in an error-such as 500 Internal Server Errors, network outages, or DNS failures. By serving cached data instead of propagating the error, applications can stay available and respond gracefully during temporary upstream disruptions. Documentation is available for configuring the directive.

Sources: