4 ms·
That's a good point, I didn't consider having the browser cache the document. That means you can achieve the same thing with the HTTP cache. (I'm not sure if th
by mostlystatic 7y ago
That's a good point, I didn't consider having the browser cache the document. That means you can achieve the same thing with the HTTP cache. (I'm not sure if the retention logic between the service worker cache and the HTTP cache differs much.)
Service workers give you more control about what's in the cache, for example you can serve a stale version of the HTML and then fetch an up-to-date version in the background. But since last year you can also use `Cache-Control: max-age=1234, stale-while-revalidate=86400`, so it should be possible with the HTTP cache as well now.