Return-Path: X-Original-To: apmail-hc-dev-archive@www.apache.org Delivered-To: apmail-hc-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 802979FBC for ; Fri, 10 Feb 2012 10:22:45 +0000 (UTC) Received: (qmail 81230 invoked by uid 500); 10 Feb 2012 10:22:44 -0000 Delivered-To: apmail-hc-dev-archive@hc.apache.org Received: (qmail 79524 invoked by uid 500); 10 Feb 2012 10:22:30 -0000 Mailing-List: contact dev-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpComponents Project" Delivered-To: mailing list dev@hc.apache.org Received: (qmail 78234 invoked by uid 99); 10 Feb 2012 10:22:22 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Feb 2012 10:22:22 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Feb 2012 10:22:19 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 83A6D1AE2AB for ; Fri, 10 Feb 2012 10:21:59 +0000 (UTC) Date: Fri, 10 Feb 2012 10:21:59 +0000 (UTC) From: "Aaron Gaudio (Commented) (JIRA)" To: dev@hc.apache.org Message-ID: <1894138390.23703.1328869319540.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1784027619.11275.1305320147411.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (HTTPCLIENT-1090) CachingHttpClient should be able to cache ResponseHandler responses (or the result of some new form of ResponseHandler) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HTTPCLIENT-1090?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13205333#comment-13205333 ] Aaron Gaudio commented on HTTPCLIENT-1090: ------------------------------------------ I am just looking at upgrading to the latest HttpClient version and was wondering about this very issue. For the most part, this could be implemented inside the ResponseHandler implementation itself (or, more generically, a ResponseHandler Decorator), by looking to see if the response was a cache miss or not, via CachingHttpClient.CACHE_RESPONSE_STATUS. This would let you react to cache misses or hits. It would also give you the flexibility for managing your object cache separate from your http response caches, but linking the two. The only thing that would be missing would be the ability to invalidate an entry from your own cache in response to the http resource being invalidated. Could this be accomplished via a custom/decorating HttpCacheStorage? > CachingHttpClient should be able to cache ResponseHandler responses (or the result of some new form of ResponseHandler) > ----------------------------------------------------------------------------------------------------------------------- > > Key: HTTPCLIENT-1090 > URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1090 > Project: HttpComponents HttpClient > Issue Type: Improvement > Components: HttpClient > Affects Versions: 4.1.1 > Environment: Mac OS X 10.6.7 + Eclipse Helios SR2 > Reporter: David Waite > Priority: Minor > Fix For: Future > > > When creating a ResponseHandler to parse the response value into a usable java object, I notice that the code is executed every time, even if the response object is served from cache. It would be nice to have a system where a ResponseHandler can be written such that its value is also served from cache. This may require a different interface which: > - Exposes just the values which are not altered when served from a cache > - Returns objects which can be cached out of process ( through documentation, and having the return type extend Serializable) > Alternatively, if there is a header uniquely identifying a response, a WeakHashMap could be used to provide a cache associating a response with a created object (although such a cache would not correlate to the HTTP cache in terms of retention) -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org For additional commands, e-mail: dev-help@hc.apache.org