workbox
workbox copied to clipboard
Long queue time on the initial index.html request during SW update with heavy precache
Welcome! Please use this template for reporting bugs or requesting features. For questions about using Workbox, the best place to ask is Stack Overflow, tagged with [workbox]
: https://stackoverflow.com/questions/ask?tags=workbox
Library Affected: workbox-precaching
Browser & Platform: all browsers
Issue or Feature Request Description:
notice long queue time on the initial index.html request when SW updates itself, especially when it requires a lot changes in precached assets, it seems the request on handling the index.html got blocked by all the other fetches happening on precache.
repro step is:
- on a website that precache a lot files (hundreds of them)
- clear the Cache but keep the service worker - you may also want to disable network cache
- enable
update on reload
for SW - reload
our precache setting is very short:
precacheAndRoute(self.__WB_MANIFEST, { ignoreURLParametersMatching: [/.*/] })
tho the __WB_MANIFEST is quite a lot, like ~500 assets , and it does include the index.html
itself, not sure if that's the issue that why index.html
request itself got queued there - I would expect it will serve the old version with the old service worker before precache finished
tried to mark precache requests to low priority but still the highest request is waiting on low priority requests, seems wrong: