proxy_cache_use_stale lets NGINX serve an expired cached response when the upstream application cannot provide a response. This can keep an app partly available during transient failures, rollbacks, or stopped containers. section 20.3
Configure the setting inside the cached location and name the upstream conditions that permit stale content:
- Use a long-lived cache for content that can remain available during an outage. section 20.3
- Choose paths carefully: cached pages may remain usable while dynamic API responses become unavailable. section 20.3
Cached web content during an outage
A web location can use `proxy_cache_use_stale error timeout invalid_header updating http_500 http_502 http_503 http_504;`. After requests populate the cache, removing the web containers still allows the site to respond. An API cache without this setting returns HTTP 502 after its one-minute cache expires.
