should beresp will be added into cache?

Poul-Henning Kamp phk at phk.freebsd.dk
Tue Mar 8 08:41:26 CET 2011


In message <AANLkTimcr8HX5aP4nsDDDPDzMqqrE-774tA2Y4svkeJw at mail.gmail.com>, Junx
ian Yan writes:

>Here is my code:
>in vcl_fetch
>  if (req.url ~ "/(images|javascripts|stylesheets)/") {
>    unset beresp.http.Set-Cookie;
>    set beresp.http.Cache-Control = "private, max-age = 3600,
>must-revalidate"; # 1 hour
>    set beresp.ttl = 10m;
>    set beresp.http.clientcache = "1";
>    return(deliver);
>  }
>
>And I also wanna the response of the second request have the max-age = 3600
>and clientcache = 1. The actual result is max-age = 0 and no clientcache in
>response

Wouldn't it be easier to set the Cache-Control in vcl_deliver then ?

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.




More information about the varnish-misc mailing list