cachecontrol
cachecontrol copied to clipboard
Support for stale-while-invalidate
RFC-5861 introduces a cache-control extension "stale-while-invalidate":
When present in an HTTP response, the stale-while-revalidate Cache- Control extension indicates that caches MAY serve the response in which it appears after it becomes stale, up to the indicated number of seconds.
If a cached response is served stale due to the presence of this extension, the cache SHOULD attempt to revalidate it while still serving stale responses (i.e., without blocking).
We're talking to a service that uses this directive, which is causing our client to log an error:
cachecontrol.controller | Ignoring unknown cache-control directive: stale-while-revalidate
AFAICT stale-while-invalidate is not an official directive and is not part of RFC-7234 (caching), but there might be value in supporting it in cachecontrol nonetheless.
yeah, would be nice to have this.
My application could also use stale-if-error to improve reliability