Dreampress and country level geolocation



Hi there

I have a site that relies heavily on geolocation - country based geolocation - to serve up different images and links in a page depending on where the user is visiting from

I also use a session cookie to store the user’s location, rather than checking each time

My site has grown quite rapidly, and my dreampress performance is now degrading, and I’m guessing that my technique for serving up country specific information is disabling varnish. That’s my theory anyway.

Is there a way, using varnish, to have a country specific cache? I notice that a CDN like Cloudflare allow for geolocation https://support.cloudflare.com/hc/en-us/articles/200168236-What-does-Cloudflare-IP-Geolocation-do-

which I could use, but is it even worth using Dreampress with Cloudflare?


Whoof. That’s a big question.

To answer one right away, using session cookies invalidates most caches. You’re basically telling the server “This user needs a special version of my site.” And as you noticed, Varnish and Geolocation are not good friends. There’s nothing built in to Varnish for it, unless you rebuild it with special add-ons (vmods) which we have not yet done.

Now is Cloudflare ‘worth’ using with DreamPress? It can be. And in your situation, it sounds like it may be. You certainly could try it out to find out, but yeah, not a great situation :frowning: