Request to clarify documentation Stale-While-Revalidate
TheNewSound opened this issue · comments
Library Affected:
workbox-strategies
Browser & Platform:
Issue or Feature Request Description:
This is a request to update the documentation of the Stale-While-Revalidate strategy and possibly other strategies as well (e.g. Network-First).
https://developer.chrome.com/docs/workbox/modules/workbox-strategies#stale-while-revalidate
From other information (e.g. on web.dev) it is clear that the Service-Worker Cache is in front of the HTTP Cache.
The documentation on stale-while-revalidate of workbox mentions: "this strategy will always make a revalidation request, regardless of the age of the cached response"
and "The network request is then used to update the cache"
, but does not explicitly mention if the HTTP Cache is bypassed or not. From the cache hierarchy I infer that when the Service-Worker makes a network request, it is still up to the HTTP Cache to serve a cached response or to truly make a request over the network.
Some clarification would be appreciated on whether the HTTP Cache is bypassed and Stale-While-Revalidate truly sends a network request (to the server), or whether the HTTP Cache is still allowed to sent a 'fresh' cached response (e.g. age < max-age) and not actually revalidate with the server.
The pictures also depict 'network' but it would be more accurate to show the HTTP Cache in front of the 'Network' if the workbox strategies do not bypass the HTTP Cache.
Hi there,
Workbox is moving to a new engineering team within Google. As part of this move, we're declaring a partial bug bankruptcy to allow the new team to start fresh. We realize this isn't optimal, but realistically, this is the only way we see it working. For transparency, here're the criteria we applied:
- For PRs, we closed everything that doesn't target the current
v7
branch. - For Issues, we closed everything that was created before 2024.
Thanks, and we hope for your understanding!
The Workbox team