Re: [w3c/ServiceWorker] [Feature request] Allow keeping service worker alive (#1558)

> i have seen some fetch requests being ignored by the service worker while it was still "activating" ... can this be prevented ? i.e. can all fetch request wait that the service worker wakes up first, then fire?

Short answer: No. If you need to make sure fetch requests get intercepted by a Service Worker, then wait for that service worker to be activated before sending those fetch requests.

Longer answer: Yes, I think this might be possible with a hacky work-around. You could have your Service Worker *identify as* "activated" synchronously/immediately, while deferring the *real* semantic activation and serving all events `event.respondWith(actualActivationPromise.then(() => makeResponse(event)))`

-- 
Reply to this email directly or view it on GitHub:
https://github.com/w3c/ServiceWorker/issues/1558#issuecomment-2206993585
You are receiving this because you are subscribed to this thread.

Message ID: <w3c/ServiceWorker/issues/1558/2206993585@github.com>

Received on Wednesday, 3 July 2024 18:58:58 UTC