max-age

Lars Jørgensen ITLJ at gyldendal.dk
Tue Dec 14 09:24:14 CET 2010


>if (beresp.http.content-type ~ "pdf") {
>    unset beresp.http.expires;
>    unset beresp.http.cache-control;
>    set beresp.http.cache-control = "max-age = 1d";
>    set beresp.ttl = 86400s;
>}

And if you can't do seconds-to-days calculations in your head, you can specify it like this

set beresp.ttl = 24h;

or even

set beresp.ttl = 14d;


Lars



More information about the varnish-misc mailing list