arturobernalg commented on PR #420:
URL: 
https://github.com/apache/httpcomponents-client/pull/420#issuecomment-1464959240

   > @arturobernalg There is a simpler, nicer fix. Wanna try to find it?
   > 
   > Bonus question: what should the value of max-age be with the header like 
`Cache-Control: no-cache, max-age=123`?
   
   I just rt
   
   > @arturobernalg There is a simpler, nicer fix. Wanna try to find it?
   > 
   > Bonus question: what should the value of max-age be with the header like 
`Cache-Control: no-cache, max-age=123`?
   For what I understand a cache MUST NOT use a response to satisfy a 
subsequent request without successful revalidation with the origin server if 
the Cache-Control header field includes the "no-cache" directive. However, it 
MAY use the response to satisfy a subsequent request if the Cache-Control 
header field contains a "max-age" directive with a non-zero value.
   
   In the given header "Cache-Control: no-cache, max-age=123", the "no-cache" 
directive takes precedence over the "max-age" directive, but the presence of 
"max-age" means that the response can be used to satisfy a subsequent request 
after 123 seconds have elapsed, assuming successful revalidation with the 
origin server. So the value of max-age should be 123 seconds.
   
   Regarding the simple fix, we can return the CacheControl object since we 
have already extracted the relevant caching directives from the Cache-Control 
header by this point.


-- 
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]

Reply via email to