Re: [ServiceWorker] Cache should sanitize the stored Request in put/add/addAll (#664)

I think we should store the context attribute if the Request is stored through Cache.put (which does not perform a "fetch").  As an author, I would find it quite surprising to Cache.put() something into the database and find its context value to have changed after reading it back.

Discussing this with @wanderview on IRC, he mentioned a good point about Cache not being able to filter based on the context value, so we can never store two Requests that only differ in their context side by side which I think is a good point, but I think it's better to extend Cache to add that functionality.  I can see use cases where you may want to store two different responses for requests differing only in context.  One example would be for example youtube video embeds, where you may want to store a different synthesized Response in the cache for Requests coming from iframes and requests loaded outside of an iframe.

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

Received on Friday, 27 March 2015 14:23:07 UTC