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 loses response status and headers on cache hit #6505
The upstream HTTP status code and other response headers are not cached or replayed. This changes response semantics after the first request. For example:
an upstream 404/500 response body can be replayed as a default gateway 200 on cache hit;
a cached 302 loses the Location header;
Set-Cookie, Cache-Control, and other important headers are dropped on cache hit.
Expected behavior
A cached HTTP response should preserve the response semantics that ShenYu returned when the entry was stored. At minimum, the cache entry should include and restore the HTTP status code and relevant response headers, or the cache plugin should explicitly avoid caching responses whose status/headers cannot be safely replayed.
How to reproduce
Enable the cache plugin for a route.
Let the upstream return a non-200 response, or a redirect response such as:
HTTP/1.1 302 Found
Location: /new-location
Content-Type: text/plain
Send the first request so the cache entry is created.
Send the same request again.
The cache hit path returns only cached body/content-type and does not restore the original status or headers.
Cross-link: related to #6506 — both are CachePlugin correctness defects. This issue is about the cache entry scope (status code & response headers lost on cache hit, CachePlugin.java:139-150 stores only body+contentType), while #6506 is about the cache key (ignores HTTP method & body, CacheUtils.java:45-49). Worth fixing together in one CachePlugin pass.
Activity
github-actions commentedon Jul 31, 2026
👋 Hello @yuluo-yx
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 #6506 — both are CachePlugin correctness defects. This issue is about the cache entry scope (status code & response headers lost on cache hit,
CachePlugin.java:139-150stores only body+contentType), while #6506 is about the cache key (ignores HTTP method & body,CacheUtils.java:45-49). Worth fixing together in one CachePlugin pass.[ISSUE #6505][ISSUE #6506] Preserve HTTP response cache semantics (#7662