arturobernalg commented on code in PR #609:
URL:
https://github.com/apache/httpcomponents-client/pull/609#discussion_r1907881257
##########
httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/ResponseCachingPolicy.java:
##########
@@ -248,6 +256,9 @@ protected boolean isExplicitlyCacheable(final
ResponseCacheControl cacheControl,
if (response.containsHeader(HttpHeaders.EXPIRES)) {
return true;
}
+ if (cacheControl.getMaxAge() == 0 && cacheControl.isMustRevalidate()) {
Review Comment:
@ok2c
Section 3.5 allows a shared cache to reuse responses with an Authorization
header if directives like must-revalidate are present.
Section 5.2.2.2 states that when must-revalidate is set, the cache MUST
NOT reuse the response once stale, requiring immediate validation.
Setting max-age=0 forces the response to become stale immediately,
triggering revalidation as required by must-revalidate. This approach minimizes
ambiguity but admittedly, RFC 9111 doesn't explicitly prescribe max-age=0 over
max-age=1, leaving some room for interpretation regarding minimal reuse windows.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]