Problems with Cache-Control: max-age=0
Mike Adolphs
mike at matejunkie.com
Sun Jul 11 12:12:00 CEST 2010
Hi,
I've just been playing around with Varnish since yesterday, read the
various examples and thought I'll give it a try with caching munin
generated png's for 3600s (just as a test). When I now refresh the
page I see that the cache is missed. Couple of seconds and a refresh
later I see that the cache gets hit.
So far so good, but a few minutes later new requests hit the backend
again instead of getting its content from the cache. How do I alter
the incoming request's header to unset or alter the Cache-Control:
max-age=0? Is that possible?
My current config looks like the following, but this is obviously for
backends that sends "Cache-Control: no-cache, no-store, max-age=0,
must-revalidate":
sub vcl_recv {
if (req.request == "GET" && req.url ~ "\.(html|jpg|jpeg|gif|ico|png)$") {
lookup;
}
}
sub vcl_fetch {
if (req.request == "GET" && req.url ~ "\.(html|jpg|jpeg|gif|ico|png)$") {
set obj.ttl = 3600s;
}
}
Best regards,
Mike
--
Mike Adolphs
Stitenstrasse 24
23554 Luebeck
- Germany -
Mail. mike at matejunkie.com
Web. http://www.matejunkie.com/
XING. http://www.xing.com/profile/Mike_Adolphs
More information about the varnish-misc
mailing list