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

Besides the redundant-fetch-for-the-same-resource issue, some points about the cache behavior under the committing-on-header decision:

> However, if you have code that tries the cache, falls back to the network and adds to the cache, you can end up with multiple pages doing this with the same resource, as cache.match won't return items until it's fully cached.

It seems not necessarily true now as `.match` should return in-progress items.

> If you call .match(request) and there's already a match fully-written in the cache, you'll get that rather than the in-progress one. This seems sensible to me, but we could favour the in-progress one.

Frequent matched in-progress responses can affect some negative offline user experience I guess. So serving the fully-written response with the higher priority seem a must.


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

Received on Friday, 12 December 2014 09:43:35 UTC