max-age

Stefan Pommerening pom at dmsp.de
Mon Dec 13 19:10:46 CET 2010


Am 13.12.2010 18:24, schrieb alexus:
> how/where can I define a cache (max-age) in default.vcl ?
> I have few PDF files that being cached and 2 weeks seems a bit much in
> my opinion, I'd like to change that.

Add some code - similar to the following EXAMPLE - to vcl_fetch:

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;
}

Stefan





More information about the varnish-misc mailing list