- From: mamumu123 <notifications@github.com>
- Date: Thu, 14 Jul 2022 18:53:08 -0700
- To: w3c/ServiceWorker <ServiceWorker@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Friday, 15 July 2022 01:53:22 UTC
I have a very simple example here. [example](https://mamumu123.github.io/sw-test/) First of all, I copied this repo( https://github.com/mdn/sw-test ), it was very smooth. Next, I made some changes. I add 1000 pictures(or more) in 'cache.add', When reloading, then i found that the main thread is block.  ```js +const lotList = []; +for (let index = 1; index < 1000; index++) { + lotList.push(`/sw-test/gallery/${index}.jpg`); +} + const putInCache = async (request, response) => { const cache = await caches.open('v1'); await cache.put(request, response); @@ -69,6 +74,7 @@ self.addEventListener('install', (event) => { '/sw-test/gallery/bountyHunters.jpg', '/sw-test/gallery/myLittleVader.jpg', '/sw-test/gallery/snowTroopers.jpg', + ...lotList, ]) ); }); ``` step: step1: add 1000 image, step2: tick ‘update on reload’ step3: reload Then, the above problem will recur -- Reply to this email directly or view it on GitHub: https://github.com/w3c/ServiceWorker/issues/1650#issuecomment-1185088690 You are receiving this because you are subscribed to this thread. Message ID: <w3c/ServiceWorker/issues/1650/1185088690@github.com>
Received on Friday, 15 July 2022 01:53:22 UTC