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

Cache request verbs separately #34

Merged
merged 6 commits into from
May 13, 2024

Conversation

Zegnat
Copy link
Contributor

@Zegnat Zegnat commented Aug 14, 2023

Fixes #20.

See the tests for cases that are covered. In short:

  1. Different HTTP methods (GET, POST, …) to the same URL are now cached independently.
  2. Requests with different bodies are now cached independently.

This keeps backwards compatibility with the normal GET case so existing caches should continue to work for those.

There is more that could have been added. Such as independent caches based on request headers. But I think the use-case for those is getting way more fringe. But the code should make it easy for anyone to introduce such a patch themselves.

@zachleat zachleat merged commit d6ee43a into 11ty:master May 13, 2024
@zachleat zachleat added this to the Eleventy Fetch v5.0.0 milestone May 13, 2024
@zachleat
Copy link
Member

Thank you! Shipping with v5.0

@Zegnat Zegnat deleted the cache-request-verbs-separately branch June 2, 2024 13:50
@zachleat zachleat added the enhancement New feature or request label Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for caching non-GET requests
2 participants