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

fetch does not allow caching requests with a null client #1749

Open
cbiesinger opened this issue May 1, 2024 · 1 comment
Open

fetch does not allow caching requests with a null client #1749

cbiesinger opened this issue May 1, 2024 · 1 comment
Labels
addition/proposal New features or enhancements needs implementer interest Moving the issue forward requires implementers to express interest

Comments

@cbiesinger
Copy link
Contributor

What problem are you trying to solve?

The FedCM spec (https://fedidcg.github.io/FedCM/) makes a number of fetch requests with a null client, such as https://fedidcg.github.io/FedCM/#fetch-config-file. But fetch does not support caching requests with a null client because the cache partition is null (https://fetch.spec.whatwg.org/#network-partition-keys via https://fetch.spec.whatwg.org/#http-cache-partitions). Because these files change rarely, it is desirable to be able to cache them if requested by the server using standard HTTP headers

What solutions exist today?

Only solution today is to cache them in the caller of fetch, which is a lot of complexity to duplicate what the HTTP cache does today

How would you solve it?

Probably one of:

  • add a property to fetch requests named something like "cache fallback environment" that would be used by the cache partition key algorithm
  • allow the fetch caller to specify a network partition key directly (not exposed to JS, of course)

Anything else?

@domfarolino suggested not using the "reserved client" for this purpose because it's meant to be used for navigation requests

@cbiesinger cbiesinger added addition/proposal New features or enhancements needs implementer interest Moving the issue forward requires implementers to express interest labels May 1, 2024
@annevk
Copy link
Member

annevk commented May 2, 2024

See also #1296 and #1673.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addition/proposal New features or enhancements needs implementer interest Moving the issue forward requires implementers to express interest
Development

No branches or pull requests

2 participants