Q:

Geo location / filtering and HTTP Caching

I'm trying to add cache support (both HTTP and server) for a ASP.NET Web Api solution. 
The solution is geo located, meaning that I can get different results based on the caller IP address. 
The question can be trivially solved for the server side cache, using an approach similar to  VaryByCustom (like this one). However that does not solve the problem with the client side HTTP caches. Here are the alternatives 
I'm considering the following options:

Enforcing a must-revalidate in the cache
Keep the validation server side using the same algorithm to VaryByCustom, but include the extra cache revalidate calls on the server side with ETAGS or any mechanism that keep track of the originally cached value country of origin. 
Creating country specific routes HTTP 302
In this scenario an application invoking 
http://site/UK/content

Redirects to US version if originating from an US IP address when the cache has expired
http://site/US/content

It might present out-of-date contents that do not match the IP of origin local. That is not a serious problem if the cache expires is a small value (< 1 hour), since country changes are fairly uncommon.

What is the recommended solution?

A:

After detailed evaluation first approach was chosen. Actual implementation is:

Create a cache key that depends on the country of origin IP address
Create a ETag for that cache key and store it in Server cache
Additional requests that include ETag If-None-Match header are evaluates in server for cache freshness:

If the country of origin is the same, the cache key will be the same and ETag is valid, returning a HTTP 304 not modified
If the country of origin is different, cache key will be different and such the ETag is not valid, returning a HTTP 200 and returning a new ETag.

Agree with Poul-Henning Kamp geolocation should be a transport level thing, but unfortunately is not, so this is the only way we could come up with to ensure cache freshness for a given country.
The disadvantage is that cannot have any infrastructure cache, e.g., all requests need to check the server for cache freshness.

