Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Caching fails to download assets in Chrome 85 #486

Open
jampy opened this issue Sep 2, 2020 · 1 comment
Open

Caching fails to download assets in Chrome 85 #486

jampy opened this issue Sep 2, 2020 · 1 comment

Comments

@jampy
Copy link

jampy commented Sep 2, 2020

As stated here, Chrome now dislikes lots of parallel fetch() invocations unless the response body is consumed.

This practically prevents the initial download of the offline-plugin cache and also consequent updates. The Service Worker fails to install.

It's stuck in this status and fails after 10 minutes or so:

image

It took me a whole day to track down the problem to this code: https://github.com/NekR/offline-plugin/blob/master/src/misc/sw-template.js#L605

I don't want to say that the code is wrong but due to the behavior of Chrome the Promise.all() must be changed so that fetch() and cache.put() are done together.

I'm out of time to help you with a pull request on the master branch but here is my patched version for the 4.9.1 version: https://gist.github.com/jampy/4330e2008b09450da72a25aba2aa90be#file-sw-template-js-L629

jampy pushed a commit to jampy/offline-plugin that referenced this issue Sep 2, 2020
@jampy
Copy link
Author

jampy commented Sep 3, 2020

FYI, my patch needed a little fix. Here is the better version: https://gist.github.com/jampy/635ab91e60907a7fe38fb18a1c11a94d#file-sw-template-js-L631

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

No branches or pull requests

1 participant