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 6BC2A9B70 for ; Thu, 15 Mar 2012 17:40:01 +0000 (UTC) Received: (qmail 17430 invoked by uid 500); 15 Mar 2012 17:40:01 -0000 Delivered-To: apmail-hc-dev-archive@hc.apache.org Received: (qmail 17386 invoked by uid 500); 15 Mar 2012 17:40:01 -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 17368 invoked by uid 99); 15 Mar 2012 17:40:01 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Mar 2012 17:40:01 +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; Thu, 15 Mar 2012 17:39:58 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id B61E221913 for ; Thu, 15 Mar 2012 17:39:37 +0000 (UTC) Date: Thu, 15 Mar 2012 17:39:37 +0000 (UTC) From: "Jon Moore (Commented) (JIRA)" To: dev@hc.apache.org Message-ID: <250268585.19827.1331833177747.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1426001806.35840.1329211199437.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (HTTPCLIENT-1164) Compressed entities are not being cached properly MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HTTPCLIENT-1164?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13230348#comment-13230348 ] Jon Moore commented on HTTPCLIENT-1164: --------------------------------------- @Oleg: I just wired up the CompressionDecorator around a DefaultHttpClient and the connections seem to be reused just fine, per wire logging + context logging. The DefaultConnectionKeepAliveStrategy doesn't seem to look at the Content-Length header. Am I missing something? > Compressed entities are not being cached properly > ------------------------------------------------- > > Key: HTTPCLIENT-1164 > URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1164 > Project: HttpComponents HttpClient > Issue Type: Bug > Components: Cache > Affects Versions: Snapshot > Reporter: Manish Tripathi > Assignee: Jon Moore > > org.apache.http.impl.client.cache.CacheValidityPolicy.contentLengthHeaderMatchesActualLength() returns false for entities decompressed by ContentEncodingHttpClient, because the length of decompressed entity stored in cache will be different from the length specified in the response header. > Consequently, gzipped/deflated entities will never be satisfied from the cache. > Proposed fix: introduce new field in HttpCacheEntry() - actualContentLength, and populate it with the actual content length rigth before the cache entry is stored in the cache. Change the org.apache.http.impl.client.cache.CacheValidityPolicy.contentLengthHeaderMatchesActualLength() method to compare > entry.getResource().length() with entry.getActualContentLength() -- 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