Re: [w3c/ServiceWorker] provide a way to execute work after browser has consumed a response (#1397)

The use case makes sense to me too.

respondWith is calling waitUntil under the hood so that waitUntil for fetch events is probably not used much. Also, the tasks done in doCompletionWork are probably often fast. The need to call waitUntil will not be as evident as for other service worker events so it seems best to automate it.
I would be leaning towards afterResponse.

As of the exact details, listing some existing/envisioned use cases might help.
Caching a response being fetched might be one example.

Some related questions:
- Is it useful for doCompletionWork to access the response given to respondWith?
- Is the work done by doCompletionWork the same if respondWith is called or not?
- Should doCompletionWork be called only if respondWith is called?

-- 
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/1397#issuecomment-479336553

Received on Wednesday, 3 April 2019 04:36:27 UTC