Country based cloudflare caching

I have a website that shows different content depending on the user country, but I faced an issue with Cloudflare enabled, which caches full page output and returns wrongly for other countries.

Tried to look into custom cache keys or some ways to cache pages by country but couldn’t find the solution.

What comes to my mind is by using Cloudflare Workers or Transform/Cache Rules? :thinking:

How do you determine which content should be presented by the country for a visitor?
By the IP, or accept language from Web browser, or some other way around? :thinking:

May I ask if the content is dynamically generated to the visitor? Therefore, it cannot be cached “once” as it does changes to each visitor?
If that happens, does the URL change or stays the same? (does it have some “prefix” or “suffix” like /en/, /de/, etc.)?

Yes, we use commerical geiop database and determine content forneach country not user depending.

The url alsways stays same.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.