You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Jonathan Moore (JIRA)" <ji...@apache.org> on 2010/09/08 21:43:33 UTC

[jira] Commented: (HTTPCLIENT-992) cache should not generate stale responses to requests explicitly requesting first-hand or fresh ones

    [ https://issues.apache.org/jira/browse/HTTPCLIENT-992?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12907377#action_12907377 ] 

Jonathan Moore commented on HTTPCLIENT-992:
-------------------------------------------

By the way, here was something I could use a little input on, behavior-wise:

Suppose we have a cache entry dated 10 seconds ago with 'Cache-Control: max-age=5'. This is now 5 seconds stale and has an age of 10 seconds. If a client asks for this entry with 'Cache-Control: max-age=20', what should we do, if the revalidation with the origin fails?

(a) return the stale cache entry, as the overall age of the request is less than the max-age requested
(b) return a 504 (Gateway Timeout), since max-age on a request assumes the cache entry is still fresh and just tightens the freshness constraints; if the client was ok with a stale entry they would have used 'max-stale' instead

The current patch does (a), preferring to returning a stale entry over a 504 error, but I am actually leaning a little towards (b) now. I think 'max-age' on a request means "I want a *fresh* response no older than this".


> cache should not generate stale responses to requests explicitly requesting first-hand or fresh ones
> ----------------------------------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-992
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-992
>             Project: HttpComponents HttpClient
>          Issue Type: Improvement
>          Components: Cache
>    Affects Versions: 4.1 Alpha2
>            Reporter: Jonathan Moore
>         Attachments: stale-responses-to-explicit-requests.patch
>
>
> The current implementation will serve a stale response in the case that it has a stale cache entry but revalidation with the origin fails. However, the RFC says we SHOULD NOT do this if the client explicitly requested a first-hand or fresh response (via no-cache, max-age, max-stale, or min-fresh).

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