11ty / eleventy-fetch

Utility to cache any remote asset: Image, Video, Web Font, CSS, JSON, etc
https://www.11ty.dev/docs/plugins/fetch/
144 stars 19 forks source link

Cache request verbs separately #34

Closed Zegnat closed 5 months ago

Zegnat commented 1 year ago

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 commented 5 months ago

Thank you! Shipping with v5.0