Re: [whatwg/fetch] Browsers preserve fragments on redirects (#505)

>  I agree that any caches should not store fragments and ignore them when they are used in a key.

I understand ignoring them in the request url key, but why would we not preserve them on response.url when the response is stored in cache_storage?  I didn't follow that part.

> So maybe we should treat the service worker as being able to supply us with responses and those responses keep their own URL identity, but only up to the fragment, which is always set by the request, be it to null or a string.

I think this would miss some use cases.

Consider the use case from https://github.com/whatwg/fetch/issues/505#issuecomment-365373835.  We have a request to an svg with multiple sprites in it and the fragment identifies which one to display in an `<img>`.  Consider that the service worker wants to return a different svg with a different set of sprites.  The anchors in this new svg may not map to the anchors in the original svg.  The service worker should be able to identify a different sprite within its chosen svg with a new/different fragment.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/issues/505#issuecomment-778274103

Received on Friday, 12 February 2021 15:49:00 UTC