Re: [ServiceWorker] Can caches store and retrieve results that are still being written to the cache? (#573)

Defined _fetching record_ (an in-progress match) and _incumbent record_ (a fully-written match) for cache entry: ba025c93bcecd0ddc24ecec95fadcc7e72c562a4.

The behaviors can be summarized as:

1. We don't wait for the full body stream. Committing _fetching record_ to cache happens when response's headers are available.
2. _Incumbent records_ have higher priority always.
  * _Fetching records_ basically serve the same thing as the network request, so they're served as in-progress fetches and they're want-to-be-incumbent-records for the next fetch events.
  * When no _incumbent record_ exists, we do serve the _fetching record_
3. Fulfillment of the cache-adding methods (`add/addAll/put`) guarantees we have _incumbent records_ for those requests.



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

Received on Friday, 19 December 2014 11:59:30 UTC