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

Memory cache/list of available images interop meta-issue #6110

Open
domenic opened this issue Oct 27, 2020 · 2 comments
Open

Memory cache/list of available images interop meta-issue #6110

domenic opened this issue Oct 27, 2020 · 2 comments
Labels
interop Implementations are not interoperable with each other topic: fetch topic: img

Comments

@domenic
Copy link
Member

domenic commented Oct 27, 2020

It's been known for a long time that the spec doesn't match reality when it comes to the "memory cache", which is some sort of in-memory layer in front of the HTTP cache (see https://blog.yoav.ws/tale-of-four-caches/ for a bit more). The spec has a per-document (but also shareable-between-documents) "list of available images", but Blink and WebKit implement something more general. I believe Gecko implements the spec's image cache, but also a non-specced stylesheet cache. There's also some connection to the also-unspecced preload cache, it seems.

The open issues I could find regarding this are: #5674, #2465, whatwg/fetch#590, #154, https://www.w3.org/Bugs/Public/show_bug.cgi?id=25798.

Solving this problem with one grand spec edit seems very hard. And there are so many issues to go through on the conceptual level (e.g. cache scope, cache keys, interaction with preloads, interaction with HTTP headers, etc.) Instead, perhaps we could concentrate on specific non-interoperable scenarios, ideally inspired by bugs that web developers have encountered in the wild, and work toward conclusions on them. That's what I'd like to use this issue for.

Hopefully we can come to an agreement on the desired behavior in each scenario, and then commit a .tentative web platform test for it, and get all browsers to align. Maybe eventually we could write spec text, but staying focused on the interop pain and driving it down through tests + browser bugs seems like the right initial focus.

Folks who have mentioned being interested in this area in the past: @emilio @domfarolino @yoavweiss. I'd also love to hear from some Apple folks if they've run into anything; I believe @smfr and @achristensen07 were at the TPAC meeting where this was discussed.

@noamr
Copy link
Contributor

noamr commented Feb 14, 2022

I took a stab at the tentative test described in the OP: web-platform-tests/wpt#32833
The main differences between browsers seem to be (as far as I'm able to observe):

  • Resource types: seems like images/fonts use this regularly, styles/scripts different per-browser
  • Respecting no-store is different across browsers

I believe these things should be spec'ed

@noamr
Copy link
Contributor

noamr commented Mar 8, 2022

One issue that needs to be addressed WRT memory cache is dynamic CSP, see #7686

If something is loaded into the memory cache and later a dynamically added CSP directive blocks that type of resource, should it be allowed or not?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
interop Implementations are not interoperable with each other topic: fetch topic: img
Development

No branches or pull requests

3 participants