NekR / offline-plugin

Offline plugin (ServiceWorker, AppCache) for webpack (https://webpack.js.org/)
MIT License
4.52k stars 295 forks source link

Delay cache download until app finishes loading #462

Closed igorfv closed 5 years ago

igorfv commented 5 years ago

Is there a way to install the app and use the cache if it exists when the user returns to the site but, at the same time, when the user accesses the site for the first time I want to download the cache only after the app bootstraps. Or at least when the app stops doing a lot of requests.

In my case, the install is configured on the app entry and I can see it starts downloading the resources before the app finishes bootstrapping. According to webpagetest it's actually delaying the bootstrap.

image

igorfv commented 5 years ago

I was expecting the install to happen only on page load but when I checked the code I noticed this is not the case.

Closing the issue