[squid-users] Re: Stale-if-error , does it work?

From: Dingwell, Robert A. <bobd_at_mitre.org>
Date: Thu, 26 Mar 2009 11:57:55 -0400

On 3/26/09 11:01 AM, "Dingwell, Robert A. (BOBD)" <bobd_at_mitre.org> wrote:

> Iıve been trying to get a caching architecture setup so that if a server I
> am caching content for goes down or is more likely just unavailable to do
> network issues I can have the cache serve up the stale content. In the
> production environment that this will be used I will not have the ability to
> have all of the services involved set cache control headers on their data. We
> are operating on a wan with people all over the globe so it would be really
> difficult to get everyone to do that. What I can do though is to make sure
> that everything goes through apache acting as a reverse proxy which then sets
> the Cache-Control header, which I have done and verified that it does indeed
> do what I want it to.
>
> So now I fire up squid and apache and attempt to access a server I have
> control over and I get back the data I expect to get back. Look in the squid
> log file see the header in the log ³Cache-Control: stale-if-error=300² so I
> know itıs being sent. Now I shutdown the server I just accessed and attempt
> to access the same url. I expect to get back the same data that I just got
> back but instead I get back the error page saying the service is unavailable.
> Shouldnıt squid be serving up the stale content? Or am I missing a step. The
> other odd thing is once I start the server back up it takes a couple of
> minutes to get back the page from server as squid seams to be caching the
> error page.
>
> I know that stale-if-error is only going to work for 500-504 errors but
> looking through the squid logs again I see that I am getting an error code
> back when I try to access the page when itıs down ³HTTP/1.1 503 Service
> Temporarily Unavailable².
>
> One last thing this article , http://www.mnot.net/blog/2007/12/12/stale ,
> makes it sound like squid has a configuration parameter that is used to enable
> stale-if-error even when the server does not send the control header. Does
> anyone know if this exists or what the magic incantation is to get it working?
>
> Anybody have any ideas as to what I may be doing wrong, or an alternative
> approach to accomplishing what I am trying to get working? I already tried
> using offline mode which did not work and I think isnıt really what I would
> want to do anyway as I need squid to attempt to access the server and serve up
> the stale data only when the server is down.
>
> Any help is appreciated ,
>
> Thanks
> Rob
Received on Thu Mar 26 2009 - 15:57:59 MDT

This archive was generated by hypermail 2.2.0 : Fri Mar 27 2009 - 12:00:02 MDT