[
https://issues.apache.org/jira/browse/HTTPCLIENT-982?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12901934#action_12901934
]
Jonathan Moore commented on HTTPCLIENT-982:
-------------------------------------------
Hi Vianney,
Yes, the cache retains the response headers it receives, and doesn't *modify*
any of them except as required by the RFC (e.g. Age, Via, Warning). Any
extension headers it added would be strictly additions (and thus retain the
semantic meaning of the origin response).
Now that I understand more of what you're asking, perhaps we could just do the
following (and Oleg, perhaps you could chime in on the usual way this is done).
Define an enum which is something like CachedResponseContext with values of:
* CACHE_HIT : response was generated from cache with no backend I/O
* CACHE_MISS: no appropriate cache entry was found
* VALIDATED: response was generated from cache after validation with origin
We could then pick a key for the HttpContext and store the result there (not
sure what the proper naming convention would be here).
Jon
> 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]