hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michajlo Matijkiw (JIRA)" <j...@apache.org>
Subject [jira] Updated: (HTTPCLIENT-1001) CacheEntryUpdater does not properly update cache entry resource
Date Wed, 29 Sep 2010 18:40:33 GMT

     [ https://issues.apache.org/jira/browse/HTTPCLIENT-1001?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Michajlo Matijkiw updated HTTPCLIENT-1001:
------------------------------------------

    Attachment: cache_update_fix.patch

This patch fixes functionality so that a stale cache entry's resource is only copied into
the new entry on 304 responses (it is still valid), and is replaced by all other responses.
 The following changes were made:

 - Move CacheEntryUpdater#updateCacheEntry() logic into BasicHttpCache#updateCacheEntry(),
if the response is not 304 then call BasicCacheEntry#cacheAndReturnResponse()
 - Deleted CacheEntryUpdater tests "testUpdateCacheEntryReturnsDifferentEntryInstance()" and
"testUpdatedEntryHasLatestRequestAndResponseDates()" - these are trivial and difficult to
test with the rearranged code
 - Added "Via" header to backendResponse in CachingHttpClient revalidation method
 - Added tests to TestBasicHttpCache to check proper updating of response body

This patch is submitted with the permission of my employer.

Thanks,
Michajlo

> CacheEntryUpdater does not properly update cache entry resource
> ---------------------------------------------------------------
>
>                 Key: HTTPCLIENT-1001
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1001
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: Cache
>            Reporter: Michajlo Matijkiw
>         Attachments: cache_entry_updater_bug_test.patch, cache_update_fix.patch
>
>
> CacheEntryUpdater#updateCacheEntry() copies the old cache entry's resource, though I
believe it should only do so if the response is a 304.  Otherwise it should take the response
from the server to update the entry.  This method gets called when validating a cache entry
and the server returns a 200 or 304.

-- 
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: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Mime
View raw message