🤖 Browsers and CDNs both lean on RFC 5861; a server-side client benefits even more, since a warm cache that never blocks on revalidation is pure tail-latency win.
stale-while-revalidate: serve the stale entry immediately, revalidate in the background.
stale-if-error: a revalidation that fails with a network/5xx error falls back to the stale entry. (Chrome effectively does this even when the directive is absent.)
First step is discovery: check what http-cache / http-cache-semantics already support — this may be an options flip, an upstream contribution, or a middleware-layer behaviour, in that order of preference. The background-revalidation half needs a task handle and single-flight per cache key, similar in shape to the probe machinery in #45.
🤖 Browsers and CDNs both lean on RFC 5861; a server-side client benefits even more, since a warm cache that never blocks on revalidation is pure tail-latency win.
stale-while-revalidate: serve the stale entry immediately, revalidate in the background.stale-if-error: a revalidation that fails with a network/5xx error falls back to the stale entry. (Chrome effectively does this even when the directive is absent.)First step is discovery: check what
http-cache/http-cache-semanticsalready support — this may be an options flip, an upstream contribution, or a middleware-layer behaviour, in that order of preference. The background-revalidation half needs a task handle and single-flight per cache key, similar in shape to the probe machinery in #45.