On 07/11/2023 17:27, Sneha Murganoor wrote:
Use case: We have Caching Apache Http Client calling s3 backend. When
metadata (http headers) changes with no changes in payload, s3 sends us
"304 NOT Modified" status code with current modified headers. But apache
reading 304 merges previous headers in cache with headers in response. So
when a particular header is removed from a 304 response, Apache still adds
this to the response which they get from cache in mergeHeaders method
CacheUpdateHandler class.


HttpClient does so because it is expected to according to the HTTP spec.

https://www.rfc-editor.org/rfc/rfc9111.html#name-updating-stored-header-fiel


RevalidateCacheEntry merges headers from cache which do not exist any more,
Is there a way that we don't revalidateCacheEntry when we are past max-age
set in cache and just call the backend?


Usually executing a conditional request and letting the origin server decide whether to send a new resource representation (200) or update the existing one (304) is more efficient and this is way HttpClient does. I am not aware of a standard way of accomplishing what you are asking by using request Cache-Control options.

Oleg

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org
For additional commands, e-mail: httpclient-users-h...@hc.apache.org

Reply via email to