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.
So my plans are these:
- Setup Nginx with GeoIP module, so I can get a X-Country: XX header on all the requests going to the app backends.
- Configure the Rails application to always return a "Vary: X-Country" response header.
- 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 (not the client browser)
Does anyone have experience with a setup like this? Anything I should be aware of?