obj.ttl derived?

Kristian Lyngstol kristian at redpill-linpro.com
Mon Sep 14 21:22:36 CEST 2009

On Mon, Sep 14, 2009 at 11:57:25AM -0700, David Birdsong wrote:
> How is obj.ttl derived when both Expires and max-age is set by the backends?
> We had a case where the backend was setting Expires to 60seconds after
> the request and max-age was 5184000.  Additionally in vcl_fetch:
> sub vcl_fetch {
>         if (obj.ttl < 9000s) {
>                 set obj.ttl = 9000s;
>         }
> }
> What would obj.ttl be set to given the Expires and max-age contradiction?

If s-maxage is set, use that as default, otherwise use max-age as default.

If Expires is sooner than the default, use that.

So in your example, the ttl should be 60s.

Kristian Lyngstøl
Redpill Linpro AS
Tlf: +47 21544179
Mob: +47 99014497
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20090914/4e01a863/attachment-0003.pgp>

More information about the varnish-misc mailing list