RFC 9211: optional Cache-Status response header - #867
Merged
Conversation
arturobernalg
force-pushed
the
cache-status-rfc9211
branch
from
August 11, 2026 18:53
7c7f470 to
ff58f82
Compare
ok2c
reviewed
Aug 16, 2026
arturobernalg
force-pushed
the
cache-status-rfc9211
branch
from
August 16, 2026 17:51
ff58f82 to
389e3e8
Compare
ok2c
reviewed
Aug 17, 2026
arturobernalg
force-pushed
the
cache-status-rfc9211
branch
from
August 18, 2026 05:51
389e3e8 to
8732618
Compare
ok2c
reviewed
Aug 18, 2026
arturobernalg
force-pushed
the
cache-status-rfc9211
branch
from
August 18, 2026 15:19
8732618 to
0fcb4cf
Compare
Adds optional support for the RFC 9211 Cache-Status response header. When enabled through CacheConfig the caching executors record how each exchange was handled in a per-exchange CacheStatus, and CacheStatusHeaderGenerator serialises it into the Cache-Status header. CacheStatus is the single source of truth for the disposition of an exchange. The coarse CacheResponseStatus exposed on HttpCacheContext is now derived from it on the fly instead of being stored as a separate attribute, so the two can no longer drift apart. A locally generated response and a stale response served by the module under stale-while-revalidate or stale-if-error map to a module response, an internal error that falls back to the origin maps to a failure, a successful revalidation of a stored entry maps to validated, a response served from a stored entry to a hit, and any other forwarded response to a miss.
arturobernalg
force-pushed
the
cache-status-rfc9211
branch
from
August 18, 2026 15:47
0fcb4cf to
4f962d1
Compare
ok2c
approved these changes
Aug 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds optional support for the RFC 9211 Cache-Status response header to the caching executors.
When enabled, the cache records how each response was produced — a cache hit,cor a forward to the origin with the reason (bypass, method, uri-miss, vary-miss, request, stale) and the upstream status code where relevant — and emits a
Cache-Status header identified as Apache-HttpClient.
Disabled by default; enabled with
CacheConfig.setCacheStatusEnabled(true).Applies to both the classic and async cache execution paths.