default_ttl applied even when Expires exist

Ricardo Newbery ric at digitalmarbles.com
Sun Apr 20 21:28:20 CEST 2008


On Apr 20, 2008, at 2:44 AM, Ricardo Newbery wrote:

>
> Noticed some odd behavior.
>
> On page with an already-expired Expires header (Expires: Sat, 1 Jan
> 2000 00:00:00 GMT) and no other cache control headers, a stock install
> of Varnish 1.1.2 appears to be applying the built-in default_ttl of
> 120 seconds when instead it should just immediately expire.  There is
> nothing in the vcl doing this so it appears that Varnish is just
> ignoring the Expires header.
>
> Can anyone else confirm?
>
> Ric



Answering my own question.

I see in rfc2616.c that this behavior is intentional.  Varnish  
apparently assumes a "clockless" origin server if the Expires date is  
not in the future and then applies the default ttl.

The solution to this -- assuming you can't change the backend behavior  
-- appears to be to manually set a default_ttl = 0.   Are there any  
potential issues with this solution?

Ric






More information about the varnish-misc mailing list