-
Notifications
You must be signed in to change notification settings - Fork 26.6k
Description
🚀 feature request
Relevant Package
This feature request is for @angular/service-worker.
Description
The Angular Service Worker currently prefetches a new version assets one by one, as mentioned in
// Cache all known resources serially. As this reduce proceeds, each Promise waits |
// Cache all known resources serially. As this reduce proceeds, each Promise waits
// on the last before starting the fetch/cache operation for the next request. Any
// errors cause fall-through to the final Promise which rejects.
Doing so with a medium/large application that heavily leverage code-splitting in inefficient: in our case we have ~340 assets to prefetch, for a total application size of only 3.0MB, yet upgrades a taking several minutes (sometimes above > 10 minutes) to be ready.
This leads to app upgrades being slower to propagate as they should be, as users have to stick around several minutes within the app for us to be able to switch to (or notify them about) the new version.
Describe the solution you'd like
New versions assets should be prefetched by the Service Worker in parallel. 3MB only takes a second to download on the average broadband connection thanks for h2+ parallelism, and the Angular Service Worker should leverage that.
Describe alternatives you've considered
I am unused if the current behavior was designed on purpose.