Re: default to cached response on error?

2013-06-07 Thread Sam Perman
Ah... cool. My responses happen to be revalidatable so sounds like this solution is just what I was looking for. Thanks! On Fri, Jun 7, 2013 at 11:19 AM, Jon Moore wrote: > On Fri, Jun 7, 2013 at 11:16 AM, Sam Perman wrote: > > > When you say the resource must be revalidatable in the current

Re: default to cached response on error?

2013-06-07 Thread Jon Moore
On Fri, Jun 7, 2013 at 11:16 AM, Sam Perman wrote: > When you say the resource must be revalidatable in the current version, > does that mean my resource server must successfully respond with a 304? > No, the origin doesn't have to respond with a 304; a 200 is fine for that. In the current imple

Re: default to cached response on error?

2013-06-07 Thread Sam Perman
When you say the resource must be revalidatable in the current version, does that mean my resource server must successfully respond with a 304? And thanks for the confirmation, Jon, regarding the build in support. I'll play around with this and see how it goes. sam On Fri, Jun 7, 2013 at 10:25

Re: default to cached response on error?

2013-06-07 Thread Francois-Xavier Bonnet
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 additi

Re: default to cached response on error?

2013-06-07 Thread Sam Perman
No, thanks for the pointer. Does CachingHttpClient support that? On Fri, Jun 7, 2013 at 8:38 AM, Francois-Xavier Bonnet < francois-xavier.bon...@centraliens.net> wrote: > Hello, > > Did you try stale-if-error request header ? > > > 2013/6/7 Sam Perman > >> Hello >> >> I'm using the CachingHttpC

Re: default to cached response on error?

2013-06-07 Thread Jon Moore
On Thu, Jun 6, 2013 at 10:24 PM, Sam Perman wrote: > 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 cac

Re: default to cached response on error?

2013-06-07 Thread Francois-Xavier Bonnet
Hello, Did you try stale-if-error request header ? 2013/6/7 Sam Perman > 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 retr

Re: default to cached response on error?

2013-06-07 Thread Oleg Kalnichevski
On Thu, 2013-06-06 at 22:24 -0400, Sam Perman wrote: > 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 > pre