We’ve run into an issue where our multi-currency website displays the wrong currency to users on first load. The issue is intermittent, and I think what’s happening is that CloudFlare is caching the page regardless of region and serving it to users. Subsequent page loads correct the issue. I think this could be solved if we could segregate the cache into geographic regions. Is this possible?
I am most definitely sure it’s not, might be (it’s a very long shot) on enterprise.
You could use workers to do that… but why do the currency selection on the server?
This is interesting because Cloudflare caches are geographically isolated. Each data center has its own cache. The only flaws in this are if you’re using Argo Network with Tiered Caching (pulling from a midpoint datacenter), or bad routing by ISPs that send Japan’s visitors to a German datacenter.
What would you suggest as an alternative? Do an async request that repeats every page load?
That is interesting indeed. I guess what I’m wondering is whether I need to use the cache at all, since our hosting provider has its own. Gets kind of difficult to track these issues down when two caches are competing.
Ah, that might be the problem. If your host caches a page for a Euro visitor, then when a Dollars visitor comes along, they may end up getting the host’s cached Euro page.
Our host has geographic caching regions that seem to work correctly. I’m guessing the Cloudflare cache, if it does too, doesn’t have the same regions and I’m seeing the areas where they don’t overlap.
Add that one to the list of “Why layered caching isn’t a great idea.”
This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.