<div class="gmail_quote"><div class="im"><br><div class="gmail_quote">On Thu, Sep 23, 2010 at 11:22 AM, Stewart Robinson <span dir="ltr"><<a href="mailto:stewsnooze@gmail.com" target="_blank">stewsnooze@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br>
change this in vcl_recv<br>
if (req.http.Authorization || req.http.Cookie) {<br>
/* Not cacheable by default */<br>
return (pass);<br>
}<br>
<br>
to<br>
if (req.http.Authorization) {<br>
/* Not cacheable by default */<br>
return (pass);<br>
}<br>
<br>
Perhaps your vcl_hash could have this appended to it<br>
<br>
if (req.http.Cookie) {<br>
set req.hash += req.http.Cookie;<br>
}<br>
<br>
I haven't tried this but I don't see why you wouldn't have individual<br>
cache entries for each cookie combo. I think this would flood your<br>
cache if you use the cookie for session info, but if you just keep<br>
simple values in cookies then this should be fine.<br></blockquote></div></div>I'm actually not seeking for a way to cache individual replies per cookie, that would indeed flood the cache.<br>I'm looking for a config that does:<br>
A) don't cache responses where the response headers say they may not be cached (read: have a Vary: Cookie header)<br> B) do cache, even when request contains a cookie, when the response tells it can be cached because it does not have a Vary: Cookie, and caries valid caching headers (max_age whatever) (not cached _per_ cookie, but cached for all requestors.)<br>
<br>So a default config for a website that uses Vary: Cookie response headers to inform varnish, whether of not responses actually depend on the cookie or not.<br><br>Isn't that how the http specs say it should be done ? Only the webserver _knows_ whether the actual response depended on the cookie or not, right ?<br>
<br><br>Regards,<br><font color="#888888">Harm<br>
</font></div><br>