I've always assumed (though not seen it explicitly stated) that the following is the path of a HTTPS request when a service worker is installed:
Just hoped that someone could confirm that this is how it works.
If with "internal cache" you mean the browser cache, then it is accessed after accessing the Service Worker cache (you need to swap your point 2 with 3).
If you set disable cache
, this will affect only the browser cache, not the Service Worker one. The requests reaching this point, meaning no match found in the Service Worker cache, will go straight to the server side.
You can think of the browser cache as a fallback cache when implementing caching strategies with Service Workers.
Below you can find the cache order followed when an HTTP Request is executed.
You can also read the web.dev article , explaining this in detail.
@Francesco linked to an article about service workers and HTTP requests (see graph in his answer). But it turns out that this graph is incomplete. Google Chrome's rendering engine Blink also has a cache that is checked first before a request is passed to the service worker. The devtools setting "Disable cache" disables Blink's cache. Explained here:
What does Blink in-memory cache store?
So in reality there are three caches, and they are passed in this order: 1. Blink's cache, 2. the service worker's cache (if implemented), and 3. the Browser cache. Add to that what ever cache is in the CDN.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.