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

Michajlo Matijkiw updated HTTPCLIENT-975:
-----------------------------------------

    Attachment: stale-while-revalidate.patch

This patch adds the 'stale-while-revalidate' cache control extension.  This is 
accomplished with an ExecutorService that qualifying requests are handed off to 
for revalidtion.  Multiple revalidations for a single URI will be collapsed 
into one request.

The number of background threads to be made available for asynchronous 
revalidation (the max number of concurrent revalidations) can be set in the 
CacheConfig object.  The default is 1, and a value of less than or equal to 0 
will tell the CachingHttpClient to ignore the stale-while-revalidate directive 
and handle all revalidations synchronously.

If applying this patch and the stale-if-error patch produce messy conflicts 
when applied I can combine the two.

This patch is contributed with the permission of my employer.

Thanks,
Michajlo

> add support to caching module for RFC 5861 (stale-on-error and 
> stale-while-revalidate)
> --------------------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-975
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-975
>             Project: HttpComponents HttpClient
>          Issue Type: New Feature
>          Components: Cache
>            Reporter: Jonathan Moore
>             Fix For: Future
>
>         Attachments: stale-if-error.patch, stale-while-revalidate.patch
>
>
> These are Cache-Control extensions that allow an origin server to specify 
> some additional behavior for stale cache entries. Stale-on-error 
> configurations allow a cache to continue serving stale content for a certain 
> period of time if a revalidation fails, and stale-while-revalidate similarly 
> allows revalidation to occur asynchronously. Some reverse proxies such as 
> Squid can be configured to understand these headers, which means that some 
> origin servers are probably sending them, and that we can likewise take 
> advantage of them.

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

Reply via email to