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.

mergeHeaders:140, CacheUpdateHandler (org.apache.hc.client5.http.impl.cache)
updateCacheEntry:94, CacheUpdateHandler
(org.apache.hc.client5.http.impl.cache)
updateCacheEntry:214, BasicHttpCache (org.apache.hc.client5.http.impl.cache)
revalidateCacheEntry:334, CachingExec
(org.apache.hc.client5.http.impl.cache)
handleCacheHit:293, CachingExec (org.apache.hc.client5.http.impl.cache)
execute:200, CachingExec (org.apache.hc.client5.http.impl.cache)
execute:51, ExecChainElement (org.apache.hc.client5.http.impl.classic)
proceed:-1, ExecChainElement$$Lambda$2548/0x000000010127fab8
(org.apache.hc.client5.http.impl.classic)
execute:96, HttpRequestRetryExec (org.apache.hc.client5.http.impl.classic)
execute:51, ExecChainElement (org.apache.hc.client5.http.impl.classic)
proceed:-1, ExecChainElement$$Lambda$2548/0x000000010127fab8
(org.apache.hc.client5.http.impl.classic)
execute:152, ContentCompressionExec
(org.apache.hc.client5.http.impl.classic)
execute:51, ExecChainElement (org.apache.hc.client5.http.impl.classic)
proceed:-1, ExecChainElement$$Lambda$2548/0x000000010127fab8
(org.apache.hc.client5.http.impl.classic)
execute:115, RedirectExec (org.apache.hc.client5.http.impl.classic)
execute:51, ExecChainElement (org.apache.hc.client5.http.impl.classic)
doExecute:170, InternalHttpClient (org.apache.hc.client5.http.impl.classic)
execute:106, CloseableHttpClient (org.apache.hc.client5.http.impl.classic)

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?

Reply via email to