Fist try to access then cache, if it fails reach for the network.
Only access the cache... usually not a good strategy
Only access the network... usually not a good strategy but can be useful for assets that never changes
Fist try to access then network, if it fails reach for the cache. Problem: if the network connection is bad, it can take some time before it succeed or failed, and in the meantime we don't serve our cached assets.
- Page reaches directly for the cache (not via service worker) AND Service Worker reach out to the network
- optional but recommended: service worker dynamically cache assets fetched from network
- service worker return fetched assets to the page
cache then network with dynamic caching