Closed vacekj closed 4 years ago
The plugin's default is 'cache-first' already, which then falls back to requesting from the network. No settings required!
Yes, however cache-first and cache then network is different. Cache first consults the cache, loads the page from cache and that's it. Only if the cache is empty it loads from network.
Cache then network tries to load it from cache, and regardless of success or failure of loading from cache, it tries to load new data from network. This way, the user gets the speed of cache along with the updated data from the network.
This is a perfect strategy for apps that are used over slow networks and at the same time updated data is critical to them.
From: Shawn Stern notifications@github.com Sent: Saturday, March 31, 2018 5:01:43 AM To: NekR/offline-plugin Cc: Josef Vacek; Author Subject: Re: [NekR/offline-plugin] [Feature request] Cache then network (#361)
The plugin's default is 'cache-first' already, which then falls back to requesting from the network. No settings required!
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/NekR/offline-plugin/issues/361#issuecomment-377661080, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AJ5nkFBxbCrg4TzBVi1tAortqoG49K7bks5tjvGXgaJpZM4TBvbn.
maybe you should by yourself reload the page on update ready
event?
Not sure if this would be possible for the plugin, but I'll think about it. It mostly caches webpack generated assets and updating them independently isn't a good idea, it simply will stop working and users may stuck with broken build and broken SW cache.
@NekR actually now I don't think that is it really a good idea (to reload the page without user prompt), I believe it should be a userland
Hi, would it be possible to add a cache then network strategy? Right now I'm using the network first, which is better than nothing, but it's still slow on slow networks. Cache first would allow the end user to see the cached version, and then whenever the new version is fetched from network, see that instead.