How much should you cache?
I mentioned earlier that you need to determine how your application's data should be cached. The type of data and how it will be used should be used as guidelines as to how it is managed in your service worker.
I want you to also consider your user. Not everyone has access to an unlimited high-speed connection or a large disk. Many smartphones still come with just 8 GB of storage, which after the operating system and all the photos and videos consumers record, there is not much room left.
Just because you could cache your entire application, including images and data, does not mean you should. Nicholas Hoizey (https://nicolas-hoizey.com/2017/01/how-much-data-should-my-service-worker-put-upfront-in-the-offline-cache.html ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access