I want to use GeoIP in nginx to serve different pages based on country. I also want to cache everything.
When a user from the US goes to my homepage, I want them to see the US version of the homepage from cache. When a user from the UK goes to my homepage, I want them to see the UK version of the homepage from cache.
After I install the GeoIP module, can I just put the country code in my cache key? Is this the best way to do it for performance, because now the server will be looking up country for each IP. I don't know if that's non-trivial.
I was thinking of getting the browser's userLanguage setting and sending via AJAX, and then caching that. Only a few characters need to be geo-located.