fetch event
The event a service worker receives for every request its pages make, which it can answer with event.respondWith().
In more detail
If the handler does not call respondWith(), the request goes to the network as normal. This is where caching strategies such as cache-first and network-first are implemented.
Related terms
- service worker — A script the browser runs in the background, separate from pages, that can intercept a site's network requests and act as a programmable proxy.
- cache-first strategy — A caching strategy that answers from the cache when possible and only goes to the network, then caches the result, on a miss.
- network-first strategy — A caching strategy that tries the network first for fresh data and falls back to the cached copy only when the request fails.
Taught in
- Cache Storage API: Offline Strategies And Cache-First Patterns — Frontend Architecture & Web Platform