AW: Varnish ALWAYS getting index from backend
Tomasz Leszczyn'ski
plzeton at gmail.com
Wed Dec 10 09:42:33 CET 2008
Neil.Scholten at scoyo.com pisze:
> 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.
Expected string variable or constant
(/etc/varnish.conf Line 19 Pos 44)
set obj.http.magicmarker = 1;
-------------------------------------------#-
VCL compilation failed
Version:
piorin:~# varnishd -V
varnishd (varnish-2.0.2)
Copyright (c) 2006-2008 Linpro AS / Verdens Gang AS
More information about the varnish-misc
mailing list