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

Jonathan Moore updated HTTPCLIENT-994:
--------------------------------------

    Attachment: max-stale.patch

The attached patch addresses this issue, as well as a simplifying refactoring. 
I even fixed another bug while I was at it.

The refactoring includes:
* Removal of the CacheValidityPolicy and associated unit test; almost all of 
this functionality was moved to the HttpCacheEntry; created a new 
TestHttpCacheEntry unit test.
* Removal of the CacheEntry test class; instead added some convenience methods 
to HttpTestUtils to allow for easily manufacturing proper HttpCacheEntry 
instances instead.

The bug fix was a minor one related to the requirement that a cache cannot 
respond with a cache entry to a request with multiple conditional headers where 
not all of them match; it turned out the test case for this was incorrect (it 
was using If-Unmodified-Since instead of If-Modified-Since in the test) and 
hence the bug wasn't immediately obvious.

This patch is contributed to the ASF with the permission of my employer.

> cache does not allow client to override origin-specified freshness using 
> max-stale
> ----------------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-994
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-994
>             Project: HttpComponents HttpClient
>          Issue Type: Improvement
>          Components: Cache
>    Affects Versions: 4.1 Alpha2
>            Reporter: Jonathan Moore
>         Attachments: max-stale.patch
>
>
> According to the RFC, the default freshness lifetime is supposed to be the 
> LEAST restrictive of that specified by the origin, the client, and the cache. 
> Right now, a client can't use 'max-stale' to relax the freshness constraints 
> to get a cache hit without validation occuring first.

-- 
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]

Reply via email to