hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Francois-Xavier Bonnet <francois-xavier.bon...@centraliens.net>
Subject Re: default to cached response on error?
Date Fri, 07 Jun 2013 14:25:54 GMT
Yes, CachingHttpClient supports this. You can add the header in the request
and CachingHttpClient will send the cached version instead of the error
page even if the cache entry is stale. For example:
Cache-Control: stale-if-error=1200
But the resource must be cacheable in the first place. In addition the
resource must also be revalidatable (Last-modified or Etag response header
in the response) in current version.



2013/6/7 <sam@permans.com>

> No, thanks for the pointer. Does CachingHttpClient support that?
>
>
> On Fri, Jun 7, 2013 at 8:38 AM, Francois-Xavier Bonnet <
> francois-xavier.bonnet@centraliens.net> wrote:
>
>> Hello,
>>
>> Did you try stale-if-error request header ?
>>
>>
>> 2013/6/7 Sam Perman <sam@permans.com>
>>
>>> Hello
>>>
>>> I'm using the CachingHttpClient and have configured a retry handler for
>>> certain types of errors... but what I really want to do is use a
>>> previously
>>> cached response (for certain types of errors) and only retry if there is
>>> no
>>> previously cached response.
>>>
>>> Is this possible?
>>>
>>> thanks
>>> sam
>>>
>>
>>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message