title: Varnish Cache & Shopping Carts
body: <p>I've been looking into Varnish recently and doing some heavy Google searching. We've recently set this up in anticipation for Christmas on our server that runs an ecommerce site. We'll be having increased return visits over the next few weeks, so using Varnish seemed like a good idea.</p>
  
  <p>I was wondering if someone could clarify something for me - when using Varnish, if a user arrives for the first time it detects a new cookie (as sessions are used for the shopping cart) and caches the pages they visit. </p>
  
  <p>However, if we wanted to cache more than a customers repeat visits, I saw on a seperate stackoverflow thread that editing the .vcl with the following will help it cache pages even if session_start is used:</p>
  
  <pre><code>     sub vcl_recv {
       unset req.http.Cookie;
       return (lookup);
       }
  
       sub vcl_fetch {
       unset beresp.http.Set-Cookie;
       set beresp.ttl = 24h;
       return(deliver);
       }
  </code></pre>
  
  <p>My question is - I'm a little confused as to the specifics of -what- would be cached. Would this cache someone's shopping cart as well, thus serving this to all visitors to that product page?</p>
  
  <p>Apologies if I'm missing a basic point of Varnish here; worst case scenario it'll help take the load off for return visits, but caching more of the site would be even better!</p>
  
  <p>Thanks very much in advance</p>