Hi,

I have configured varnish for caching static content as well as my home page
that is index.php. my config is like this for caching index.php, i trying to
set cache time 1 week for index.php but i am confused how to make sure that
index.php is cached for one week while varnish is serving from cache that is
sure i checked varnish headers.




sub vcl_recv {

if(req.request == "GET" && req.http.cookie && req.http.host ~ "^
www.example.com$" && req.url ~ "^/index\.(php)") {
        remove req.http.Set-Cookie;
        lookup;
  }
}

sub vcl_fetch {
if (req.request == "GET" && req.http.host ~ "^www.example.com$" && req.url ~
"^/index\.(php)") {

        unset obj.http.set-cookie;
        set obj.ttl = 1w;
      }
}


Can anyone please explain that why Age header is changing on every refresh
while i set "set obj.ttl" for 1 week and is the use of Age header. Is there
anything that i have to modify in my varnish config file to cache index.php.
please suggest something.

X-Varnish

473060033 473059746

Age

8713

Via

1.1 varnish


X-Varnish

473060081 473059746

Age

10141

Via

1.1 varnish



-- 
Abhishek Kumar Singh
_______________________________________________
varnish-misc mailing list
varnish-misc@projects.linpro.no
http://projects.linpro.no/mailman/listinfo/varnish-misc

Reply via email to