Re: [w3c/ServiceWorker] Detecting service worker termination (#1550)

If your ServiceWorker is doing additional processing resulting from a FetchEvent, then you will want to make sure that you are using [ExtendableEvent.waitUntil](https://w3c.github.io/ServiceWorker/#wait-until-method) to indicate that processing is ongoing.  This is best used with the new (not present in all browsers yet) [FetchEvent.handled](https://w3c.github.io/ServiceWorker/#fetch-event-handled) promise which can let you defer your processing until the response has been sufficiently processed.  See https://github.com/w3c/ServiceWorker/issues/1397 for more details/context on that.

If your processing is resource intensive or has a duration that exceeds the normal waitUntil grace periods, then it might be advisable to perform that computation in a dedicated or SharedWorker so you don't impact the responsiveness of the ServiceWorker or trigger browser interventions that mark your ServiceWorker as broken.

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

Received on Wednesday, 28 October 2020 17:48:11 UTC