Skip to content

RFC 9211: optional Cache-Status response header - #867

Open
arturobernalg wants to merge 1 commit into
apache:masterfrom
arturobernalg:cache-status-rfc9211
Open

RFC 9211: optional Cache-Status response header#867
arturobernalg wants to merge 1 commit into
apache:masterfrom
arturobernalg:cache-status-rfc9211

Conversation

@arturobernalg

Copy link
Copy Markdown
Member

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.

* Internal context attribute holding the per-exchange {@link CacheStatus} used to render the
* RFC 9211 {@code Cache-Status} header.
*/
static final String CACHE_STATUS_ATTR = "http.cache.status";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@arturobernalg Why? Why not making it a proper context attribute like CacheResponseStatus, RequestCacheControl, ResponseCacheControl, etc?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ok2c Good point — done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants