I recently went through a very similar situation. We solved it by using a vmod to do a country (and timezone, in our case) lookup, set the values in an http header, and then vary on that header.<br><br><div class="gmail_quote">On Thu Jan 29 2015 at 11:54:12 AM Guillaume Quintard <<a href="mailto:guillaume.quintard@smartjog.com">guillaume.quintard@smartjog.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div bgcolor="#FFFFFF" text="#000000">
<div>On 01/29/2015 04:35 PM, Max Clark
wrote:<br>
</div>
<blockquote type="cite">
Hello,
<div><br>
</div>
<div>We have been working to enable region specific content for
our web site. The basic mechanism is already in place,
specifically:</div>
<div><br>
</div>
<div>When a user visits the site and a cookie is not present the
application server will compare their IP address with the GeoIP
database. Based on the result the application server will
generate the proper content for the user (different logo images,
text, etc...) and return this with a cookie specifying the
edition for future requests bypassing the GeoIP lookup. The
cookie will also allow the user to select a different region
than what their IP resolves to.</div>
<div><br>
</div>
<div>Again this is working in the application, and Varnish was
extended to match on the cookie value (named "edition") and to
use the edition value as part of the hash data so there is a
unique cache for the different regions.</div>
<div><br>
</div>
<div>Here's the problem:</div>
<div><br>
</div>
<div>When a user visits the site for the first time they do not
have a cookie in the request. So Varnish has a blank value for
the edition as part of the hash data. However this request when
it hits the application server does resolve to a specific
edition and return the region content on the reply. This is
being cached by Varnish and used for future requests by new
users with no cookie.</div>
<div><br>
</div>
<div>Put simply, if the page is not in cache, and a browser from
the UK does not have the edition cookie a page with UK content
is generated and cached in Varnish. If a browser from the US
goes to the same page, Varnish will serve the US user the UK
cached page because this is what was cached based on the hash
data.</div>
<div><br>
</div>
<div>Without turning off caching for cookieless requests - how do
we resolve this?</div>
<br>
</blockquote>
<br></div><div bgcolor="#FFFFFF" text="#000000">
I may not have understood exactly what you need, but can't you hash
the country code instead of the cookie ?</div><div bgcolor="#FFFFFF" text="#000000"><br>
<br>
<pre cols="72">--
Guillaume Quintard</pre>
</div>
______________________________<u></u>_________________<br>
varnish-misc mailing list<br>
<a href="mailto:varnish-misc@varnish-cache.org" target="_blank">varnish-misc@varnish-cache.org</a><br>
<a href="https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc" target="_blank">https://www.varnish-cache.org/<u></u>lists/mailman/listinfo/<u></u>varnish-misc</a></blockquote></div>