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

Actually some clarifications are needed between the current algorithms as-is and the expected behaviors being discussed here.

> At the moment cache-adding methods resolve when the full body of the response if written to the cache. 

This was expected but the current addAll() is working in a way that the result promise resolves without waiting for the full body written to the cache.

> Shall we change this so items are added to the underlying cache as soon as we have headers?

`.match` also was not waiting for the full body written to cache to resolve with the response.

Accordingly, in order to satisfy the suggested behavior, the steps 4 to 6 should be added to the current addAll(). Plus, some further review and modification would be required in the Batch Cache Operations algorithm where the existing matched entries are being removed before new ones are being written. Well.. I need to examine further to sort them out, indeed.

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

Received on Tuesday, 9 December 2014 13:19:06 UTC