Caching issue

Daniel Papasian daniel at
Fri Mar 7 23:53:36 CET 2008

Adrian Otto wrote:
> I'm not certain if there is a VCL configuration that would cause varnish to  
> simply disregard the Pragma and Cache-Control headers from the  
> client, because anyone doing a shift+reload while your origin server  
> is down is going to get sent back to the origin server as well.

No, I believe it's a simple matter to simply disregard the Pragma and 
Cache-Control headers on incoming requests.  Most

Most simply, if you wanted to have every request do a lookup from the cache:

sub vcl_recv {

If the default.vcl I have lying around is still current, then the 
default vcl_recv doesn't appear to be looking at Cache-Control or 
Pragma, either.

But obviously you probably want to do some checks against 
req.http.Cache-Control, req.http.Pragma, req.http.cookie, and perhaps 
any other request header, before just blindly doing a lookup in the 
cache.  There are cases, however, where blindly doing a lookup could 
make sense - such as when you are in full control of not only all of the 
backends, but also all of the clients (e.g. you are putting varnish in 
front of a web application that is used by another one of your systems)


More information about the varnish-dev mailing list