You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] Cache plugin key ignores HTTP method and request body #6506
The HTTP method, request body, and other request-varying inputs are not included. The cache plugin itself does not restrict caching to idempotent GET requests. As a result, different requests to the same path/query can reuse the same cache entry.
For example, these requests share the same cache key even though they can produce different upstream responses:
POST /orders/quote
{"sku":"A","quantity":1}
POST /orders/quote
{"sku":"B","quantity":1}
The second request can receive the first request's cached body.
Expected behavior
Cache keys should include the dimensions that affect the upstream response, or the plugin should clearly restrict and validate cache usage to request shapes where path/query is sufficient. At minimum, the HTTP method should be part of the key, and body-sensitive methods should either include a body hash or be rejected unless a configured cache-key expression is provided.
How to reproduce
Enable the cache plugin for an endpoint that accepts POST requests.
Send a POST request to /orders/quote with one body and let it be cached.
Send another POST request to the same path/query but with a different body.
The second request uses the same CacheUtils.dataKey(...) value and can receive the first response from cache.
Cross-link: related to #6505 — both are CachePlugin correctness defects. #6505 loses response status/headers on cache hit (entry scope); this issue is the cache key ignoring method & body (CacheUtils.java:45-49). Worth fixing together in one CachePlugin pass.
Activity
github-actions commentedon Jul 31, 2026
👋 Hello @Aias00
A new issue has been opened by @Aias00:
Please review when you have time. Thank you! 🙏
Aias00 commentedon Aug 2, 2026
Cross-link: related to #6505 — both are CachePlugin correctness defects. #6505 loses response status/headers on cache hit (entry scope); this issue is the cache key ignoring method & body (
CacheUtils.java:45-49). Worth fixing together in one CachePlugin pass.[ISSUE #6505][ISSUE #6506] Preserve HTTP response cache semantics (#7662