title: Caching with Varnish & Varying over custom-set HTTP headers
body: <p>I'm developing your standard high traffic ecommerce website and want to setup caching with Varnish.  The particular thing on this setup is that the application will return different content depending on the user's particular location.  </p>
  
  <p>So my plans are these:</p>
  
  <ul>
  <li>Setup Nginx with GeoIP module, so I can get a X-Country: XX header on all the requests going to the app backends.</li>
  <li>Configure the Rails application to always return a "Vary: X-Country" response header.</li>
  <li>Put the Varnish server behind the Nginx and the app backends, so it can cache multiple versions of the objects served by Rails, and serve them based on the request headers set by Nginx (<em>not</em> the client browser)</li>
  </ul>
  
  <p>Does anyone have experience with a setup like this?  Anything I should be aware of?</p>