[
https://issues.apache.org/jira/browse/HTTPCLIENT-427?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12835192#action_12835192
]
Oleg Kalnichevski commented on HTTPCLIENT-427:
----------------------------------------------
Avlesh,
This is how I _personally_ think this issue should be addressed :
(1) Firstly, one needs to define an abstract API for storing and retrieving
content from an abstract cache. A single interface HttpCache (or some such) is
likely to be sufficient.
(2) Different implementations of the said caching API should be possible. The
default one can be very simple just backed by a HashMap instance. For a more
sophisticated implementation I would recommend using ehcache [1]
(3) The caching logic should be implemented as a decorator for the HttpClient
interface [2]. It should be possible to take any arbitrary instance of
HttpClient and enhance it with caching capabilities.
Oleg
[1] http://www.ehcache.org/
[2]
http://hc.apache.org/httpcomponents-client/httpclient/apidocs/org/apache/http/client/HttpClient.html
> Implement a cache to perform real request only when needed
> ----------------------------------------------------------
>
> Key: HTTPCLIENT-427
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-427
> Project: HttpComponents HttpClient
> Issue Type: Improvement
> Components: HttpClient
> Environment: Operating System: Linux
> Platform: PC
> Reporter: Marc Guillemot
> Priority: Minor
> Fix For: Future
>
>
> Browsers may cache received content according to the values of different
> response headers. It would be great if HttpClient could do the same.
--
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]