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

HTTP Cache API #1051

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open

HTTP Cache API #1051

wants to merge 19 commits into from

Conversation

guybedford
Copy link
Member

@guybedford guybedford commented Nov 22, 2024

Typing uses a variation of #1018 that uses real mutable Request and Response objects instead of relying on a new CandidateResponse object. A new error is then thrown when attempting to access the body of one of these response objects to support the CandidateResponse semantics. Effectively the CacheHandle slot being set handles the divergence here.

In the process, we also update new CacheControl('override', { ... opts ... }) to have the new direct override object syntax variation new CacheControl({ ...opts... }) as the override.

The fetch implementation is upgraded to use send_async_v2 and the new implementation is very closely based to the Rust implementation which should replicate the former caching logic in its entirety making this a backwards compatible change.

Support for the fetch cache option is not implemented here although could now be partially implemented as per #1050, which is effectively unblocked by this landing.

@guybedford guybedford force-pushed the http-cache branch 2 times, most recently from 3f13d65 to f78e621 Compare November 22, 2024 22:02
@guybedford guybedford changed the title Draft proposal for the HTTP Cache API Draft HTTP Cache API Nov 22, 2024
@guybedford guybedford force-pushed the http-cache branch 4 times, most recently from d663577 to d691bf5 Compare November 28, 2024 21:58
@guybedford guybedford changed the title Draft HTTP Cache API HTTP Cache API Nov 28, 2024
@guybedford guybedford force-pushed the http-cache branch 4 times, most recently from 1df917e to 39159e7 Compare December 14, 2024 00:53
@guybedford guybedford marked this pull request as ready for review January 2, 2025 21:30
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

Successfully merging this pull request may close these issues.

1 participant