[ 
https://issues.apache.org/jira/browse/HTTPCLIENT-982?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12902463#action_12902463
 ] 

Jonathan Moore commented on HTTPCLIENT-982:
-------------------------------------------

Ok, I am working on a patch for this, and would like to solicit some opinions. 
Current enum has:

CACHE_MODULE_RESPONSE : if the response was generated directly by the caching 
module itself (neither pulled from the cache nor taken from an upstream 
response)
CACHE_HIT : response generated from cache with no upstream request
CACHE_MISS : response came from upstream request
VALIDATED : response generated from cache after upstream validation

In the case where a cache entry is stale, and validation fails due to an 
IOException, the CachingHttpClient currently either:
(a) generates a 502 (Gateway Timeout) for must-revalidate and proxy-revalidate 
responses. I'm guessing this should be CACHE_MODULE_RESPONSE.
(b) generates a stale cache entry and attaches a Warning header. Should this be 
CACHE_HIT?

Or do we need new enum values to cover these cases?


> Could we get a way to know if the response has been served from the cache or 
> not ?
> ----------------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-982
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-982
>             Project: HttpComponents HttpClient
>          Issue Type: New Feature
>          Components: Cache
>    Affects Versions: 4.1 Alpha2
>            Reporter: Vianney Carel
>            Priority: Trivial
>
> Is there a way to know if the response has been served from the cache or not ?
> That's an information which might be useful for monitoring the activity of 
> the cache.
> If there's no current way, maybe a flag could be added in the request context 
> whenever the response comes from the cache ... ?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to