AW: Varnish ALWAYS getting index from backend
Neil.Scholten at scoyo.com
Neil.Scholten at scoyo.com
Wed Dec 10 09:30:01 CET 2008
Hi,
How about the example from the varnish-site?
http://varnish.projects.linpro.no/wiki/VCLExampleLongerCaching
Here's the example:
sub vcl_fetch {
if (obj.cacheable) {
/* Remove Expires from backend, it's not long enough */
unset obj.http.expires;
/* Set the clients TTL on this object */
set obj.http.cache-control = "max-age = 900";
/* Set how long Varnish will keep it */
set obj.ttl = 1w;
/* marker for vcl_deliver to reset Age: */
set obj.http.magicmarker = 1;
}
}
sub vcl_deliver {
if (resp.http.magicmarker) {
/* Remove the magic marker */
unset resp.http.magicmarker;
/* By definition we have a fresh object */
set resp.http.age = "0";
}
}
Worked for us so far.
--neil
-----Ursprüngliche Nachricht-----
Von: varnish-misc-bounces at projects.linpro.no [mailto:varnish-misc-bounces at projects.linpro.no] Im Auftrag von Tomasz Leszczynski
Gesendet: Dienstag, 9. Dezember 2008 23:48
An: Pablo García
Cc: varnish-misc at projects.linpro.no
Betreff: Re: Varnish ALWAYS getting index from backend
Pablo García pisze:
> Have you removed expires header ? Also, you removed those headers, but
> do you specify any expiration ?
Something like that:
sub vcl_fetch {
remove obj.http.Cache-Control;
remove obj.http.Pragma;
set obj.http.Expires = "Thu, 19 Nov 2010 08:52:00 GMT";
}
or like that:
sub vcl_fetch {
remove obj.http.Cache-Control;
remove obj.http.Pragma;
remove obj.http.Expires;
set obj.http.Expires = "Thu, 19 Nov 2010 08:52:00 GMT";
}
Not work :|
_______________________________________________
varnish-misc mailing list
varnish-misc at projects.linpro.no
http://projects.linpro.no/mailman/listinfo/varnish-misc
More information about the varnish-misc
mailing list