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

Test for the immutable attribute #70

Closed
xtuc opened this issue Apr 9, 2020 · 8 comments
Closed

Test for the immutable attribute #70

xtuc opened this issue Apr 9, 2020 · 8 comments
Labels

Comments

@xtuc
Copy link

xtuc commented Apr 9, 2020

We are considering sending Cache-Control: immutable... for files on cdnjs.com (cdnjs/cdnjs#8655). However, the browser support is not ideal and it's hard to understand what's going to happen.

It would be very helpful to us to test the immutable attribute as part of the cache tests and I would be happy to invest the time. What do you think?

@mnot
Copy link
Collaborator

mnot commented Apr 15, 2020

That would be great!

The tricky thing is to put the browsers into a state where they're reloading, to trigger the semantics of immutable. I think that could be achieved by using a cache mode of no-cache on the Fetch call, but it'd be important to verify that it has the desired effect on each browser by manually observing what's happening on the wire.

Happy to help / review / etc. as you like.

@ericlaw1979
Copy link

I have some tests and discussion at https://bayden.com/test/cache/refresh.aspx. One challenge is that there are so many different sorts of "reload" in different browsers. I think moving to fetch has improved the situation somewhat, but browsers are not all in perfect alignment.

@mnot
Copy link
Collaborator

mnot commented May 6, 2020

Hm. A quick test shows that none of the major 3 browser engines seems to honour immutable from fetch with a cache mode of no-cache.

My reading of the fetch spec's definition of those semantics (scroll down) is that they arguably should, or at least that it would make sense to; i.e., that no-cache is effectively a reload (although one might say it's a 'forced' reload; that depends on whether you take no-cache to be a indication from the client that a reload is necessary, but I'd say the major use case for that is corrupted or incomplete data, in which case reload would be the right directive).

@annevk and @mcmanus, comments?

@annevk
Copy link

annevk commented May 6, 2020

See discussion in whatwg/fetch#308.

@annevk
Copy link

annevk commented May 6, 2020

(I would love it if we could get to a point where new "protocol" features have some kind of end-to-end integration performed so that everyone is aligned on what should happen everywhere in the pipeline before we declare it ready. That might help reduce the amount of time we spent on fixing things many years into the future.)

@ericlaw1979
Copy link

none of the major 3 browser engines seems to honour
immutable from fetch with a cache mode of no-cache.

Do they all behave the same way in terms of request headers? E.g. do the requests send the same Cache-Control request header, and do they send an If-None-Match for the previously-cached resource?

@mnot
Copy link
Collaborator

mnot commented May 7, 2020

Looks like they are (max-age=0, as Fetch requires). However, note whatwg/fetch#722 .

mnot added a commit that referenced this issue Jun 25, 2020
@mnot mnot added the new test label Oct 12, 2020
@mnot
Copy link
Collaborator

mnot commented Feb 25, 2021

AFAICT we're testing this, it's just that the browsers aren't following the spec. Please add new information if you find it; closing for now.

@mnot mnot closed this as completed Feb 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants