Re: [ServiceWorker] what should Cache put operations do if the body errors out after resolving promise? (#665)

> So the body would stream to disk in the background after promise resolved.

The body would stream to disk in the background even after promise is **returned**. But the promise returned from `addAll()/put()` will resolve/reject only when the end-of-file is pushed to response's body or the response get a termination reason.

If the response gets a termination reason, the cache rolls back. That happens in [addAll()](https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html#cache-addAll) step 6.4.2.2.2 and [put()](https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html#cache-put) step 14.2.

---
Reply to this email directly or view it on GitHub:
https://github.com/slightlyoff/ServiceWorker/issues/665#issuecomment-89216340

Received on Friday, 3 April 2015 08:21:43 UTC