Ignoring refresh / force-refresh from the client

andrea.campi at zephirworks.com andrea.campi at zephirworks.com
Fri May 28 15:15:23 CEST 2010


Hi guys,

I'm working with a client who has an emergency (a backend webapp  
misbehaving because of sluggishness under load), so I deployed varnish  
in front to relieve the load.

The input from the customer is that the underlaying data doesn't  
change more often that 4 hours, so it would be good to be able to not  
send requests for a given URL more often than that.

The basic setup was a piece of cake, but I'd like to also "lie" to  
users that hit refresh (and even forced refresh, if possible) and  
still serve the request from the cache, as long as the page is fresh.

However in my tests a refresh from e.g. Firefox (with a  
"Cache-Control: max-age=0") causes the URL to be purged from the cache  
and fetched from the backend.
AFAICT obj.cacheable is still true, so I'm not sure why is that happening.

I've tried unsetting/removing req.http.cache-control and had no success.
I've also tried sending Age: 0, also no success.

Any suggestion, or pointer to documentation/blog posts/source code/whatever?

In case it matters: the backend is sending an Expires header 4 hours  
in the future, no ETag. I'm also sending a max-age.

Thanks in advance, bye,
   Andrea

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.






More information about the varnish-misc mailing list