Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spec says cache should return responses with immutable headers, but no browser does that #1456

Open
wanderview opened this issue Aug 13, 2019 · 3 comments

Comments

@wanderview
Copy link
Member

While working on a glitch for a chrome-specific issue, I noticed a weird behavior in all browsers. The spec says that the responses returned from the Cache API should be immutable. See step 5.4.2.1 here:

https://w3c.github.io/ServiceWorker/#cache-matchall

This glitch overwrites a header in a cache-returned response, though:

https://code-cache-mime-type.glitch.me/

And it appears to work in chrome, firefox, and safari. I hit some issue in edge which prevented the service worker from installing for some reason, but I couldn't figure out why.

Given that all browsers are shipping this behavior, should we change the spec? There is some risk of implementation now that sites could break if we start making these immutable now.

@jakearchibald
Copy link
Contributor

Given that all browsers are shipping this behavior, should we change the spec?

Seems reasonable.

@annevk
Copy link
Member

annevk commented Sep 12, 2019

Well, is this for all responses that can be stored in the cache? How does it work for CORS responses? There's some detail lacking here.

@jakearchibald
Copy link
Contributor

jakearchibald commented Sep 15, 2019

Whatever we do here, we should try to do the same for responses returned from fetch().

If we can't allow headers to be mutable, we should run a test to see if we can make the cache ones immutable. As in, get some usage stats.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants