Most examples of saving an 'app shell' show the process from a service worker. However I noticed that you can also access the caches object from the window.
So my question is, can I save pages for offline from the a page itself, and if so, what is the point of a service worker if this is possible?
There's a chicken-and-the-egg problem here: while your web pages can read from and write to the same caches that a service worker has access to, via window.caches, you need a service worker to intercept the initial navigation request for a web page in order to respond to it using the cache.
In other words, using window.caches presupposes that your page is already loaded, so it doesn't help you load the page while offline.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With