Multi country cache problem

Maikel Brouwer - mbrouwer at
Wed Oct 19 17:29:02 CEST 2011


I've got the following problem. Maybe someone has a solution for it. My
site is visited by two countries (Belgium and Netherlands). I have two
different advertisement agencies to display ads for the specific
countries. This means that every page how something like this:

if ($country == 'be') {
  //display stuff
} else {
  //display other stuff)

The problem is that when someone from 'be' visits the page when it's not
yet cached the code in the 'be' block will be cached. When someone from
'nl' visits the page it will see the 'be' block.

I have three of those ad blocks on every page, with 500k+ pages (dynamic


More information about the varnish-misc mailing list