Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # 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
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for caching non-GET requests
2 participants