Skip to content

Conversation

@segios
Copy link

@segios segios commented May 25, 2020

Currently make load files all at once, as I noticed it a bit faster than load them manually

@mzmrk
Copy link

mzmrk commented Oct 3, 2020

Thanks!
Your solution worked great for me. Even if its not merged yet :P
I had to change only one thing.

In service worker I replaced this line:
await cache.addAll(nextManifest.cache);
with this
for (var i=0; i<nextManifest.cache.length; i++) { await cache.add(nextManifest.cache[i]); }

Reason for this change is that for some reason if you use cache.addAll it blocks all normal fetch requests until caching is done.
For slow connections it could mean you can't refresh website for a minute or more until caching is done.
But if its split in smaller cache.add page is refreshing fine, while caching is happening in background.
Honestly I would make the same mistake. It makes no sense why addAll works like that.

Mini rant starts here :)
Anyways.
I still don't get it why AppCache is getting removed from browsers. If service workers are so great like they say, then why they didn't create compability layer where browsers would implement old appcache using new service workers automatically. It does not seem that hard.
Rant over, Cheers. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants