Your CDN’s Edge Caching Is Breaking Hreflang for International Visitors

TL;DR

CDN caching ignores geo-IP detection on your origin server, serving cached content from one country to users in another. Google crawls from the US and relies on hreflang declarations to find international versions. If your hreflang URLs redirect based on location, Googlebot sees the wrong content and your international SEO fails.


The Conversation

Sophie, international SEO manager at global e-commerce company, 15 country sites on Cloudflare, advanced SEO knowledge: We’re seeing strange patterns in our international rankings. France and Germany versions are underperforming compared to US and UK. Traffic is fine on the English sites but our European localizations aren’t ranking where they should. We implemented hreflang correctly, validated it in Search Console, no errors showing.

SDC SEO Brain: When you say underperforming, what specifically are you seeing? Lower positions than expected, or are the wrong country versions appearing in search results?

Sophie: Both. Sometimes the US version ranks in French search results instead of the French version. And our French pages rank lower than competitors who frankly have weaker content. Our on-page SEO is solid.

SDC SEO Brain: The wrong version appearing in French results suggests Google isn’t associating your hreflang correctly, or there’s a crawling issue with your French pages. Have you checked what Google actually sees when it crawls your French URLs?

Sophie: I used URL Inspection. Google renders the page correctly. Content is French, meta tags are correct, canonical points to itself. Everything looks fine.

SDC SEO Brain: URL Inspection shows what Google sees from its crawlers. But here’s a key question: does your site serve different content based on user location?

Sophie: Yes, we use geo-IP detection. Users in France automatically get French content.

SDC SEO Brain: How does that geo-detection interact with your URL structure? Do French users land on /fr-fr/ URLs automatically?

Sophie: If they visit our root domain or a non-localized URL, we redirect them to the appropriate country version. Direct links to /fr-fr/ serve French content directly. It works perfectly for users.

SDC SEO Brain: Works perfectly for users, but potentially breaks for search engines. What CDN setup are you running?

Sophie: Cloudflare, enterprise plan. Caches our pages at edge locations worldwide.

SDC SEO Brain: Where does your geo-IP detection happen? At Cloudflare’s edge or on your origin server?

Sophie: On our origin server. Cloudflare just caches and serves whatever the origin returns.

SDC SEO Brain: That’s your first problem. Cloudflare caches the response from the first request. If someone from the US hits a page first, Cloudflare caches the English US version at that edge location. When someone from France requests the same URL through that edge, they get the cached US version because Cloudflare doesn’t know it should vary the cache by location.

Sophie: But we have different URLs for different countries. /en-us/, /fr-fr/, etc.

SDC SEO Brain: Different URL paths help, but are users always hitting the correct URL initially? What happens when someone visits your homepage or a product page without the country prefix?

Sophie: We redirect them to the appropriate country version based on geo-IP.

SDC SEO Brain: And where does that redirect happen?

Sophie: On our origin server.

SDC SEO Brain: There’s a cache-related issue there too. If Cloudflare caches the redirect, it might cache the redirect to one location and serve it to everyone. User in France requests root homepage, origin returns redirect to /fr-fr/, Cloudflare caches that redirect. User in US requests same URL, gets cached redirect to /fr-fr/ instead of /en-us/.

Sophie: That would explain the French users seeing English content. The cache had an English redirect stored.

SDC SEO Brain: Exactly. For geo-based content or redirects, you need to configure your CDN to vary the cache by location. Cloudflare has a feature for this, cache by country or cache by header. The cache key includes the user’s country, so each country gets its own cached version.

Sophie: How do I set that up?

SDC SEO Brain: In Cloudflare, you can use Cache Rules to vary cache by country. Or use the Vary header with a custom header that indicates location. You might also look at Workers if you need more sophisticated logic. The key is ensuring the cache understands that the same URL should return different content based on location.

Sophie: Will this slow down our site? Creating separate cache entries for each country?

SDC SEO Brain: It increases cache storage usage but shouldn’t slow user experience. Users still get cached content; they just get their location-appropriate cached content. Cache hit rates might decrease because you’re segmenting the cache, but the tradeoff is necessary for correct international content delivery.

Sophie: What about Google? If we serve different content to different locations, does Google see the right version for indexing?

SDC SEO Brain: Google primarily crawls from the US. If your cache serves US content to US IPs, Google sees US content when crawling. Your hreflang tags tell Google that alternative versions exist for other countries. Google then crawls those alternative URLs to see the localized versions. As long as your hreflang implementation is correct and the alternate URLs are crawlable, indexing should work.

Sophie: So Google won’t see our French content unless it specifically crawls the French URL?

SDC SEO Brain: Correct. Google doesn’t typically use VPNs or geo-spoofing to see location-specific content. It crawls from its data centers, primarily US-based. Your hreflang tells Google “for French users, show this /fr-fr/ URL instead.” Google then crawls /fr-fr/ to index that version for French searches.

Sophie: We have some pages where hreflang points to URLs that redirect based on geo-IP. Could that be a problem?

SDC SEO Brain: Yes, that’s a significant problem. If your hreflang says “for France, go to /fr-fr/product” but when Googlebot crawls that URL, it gets redirected to /en-us/product because Googlebot is in the US, your hreflang breaks. Googlebot can’t see the French content you’re declaring as the French version.

Sophie: So hreflang URLs shouldn’t have geo-based redirects?

SDC SEO Brain: Exactly. Hreflang URLs must serve the declared language/country content regardless of who accesses them. If you redirect based on user location, search engine crawlers see the wrong version. Either disable geo-redirects on hreflang URLs or use a user-agent check to serve content without redirects to Googlebot.

Sophie: That user-agent approach sounds like cloaking.

SDC SEO Brain: It’s a gray area. Google has acknowledged that serving Googlebot consistent content while using geo-IP for users is necessary for international sites. The key is that what Googlebot sees matches what users in that target country see. You’re not showing Googlebot different content; you’re ensuring Googlebot sees what French users would see if they weren’t being geo-redirected.

Sophie: This is more complicated than I thought. How do I verify our current setup is working?

SDC SEO Brain: Use Search Console’s international targeting report. Check for hreflang errors. Also use URL Inspection on your international URLs and see what Google renders. Compare to what users actually see. Test from different locations using VPNs to verify user experience matches intended targeting.

Sophie: What should I prioritize fixing first?

SDC SEO Brain: Start with the redirect caching issue. Audit your geo-redirects and ensure they either bypass CDN cache entirely or the CDN varies cache by country. Then verify your hreflang URLs don’t redirect Googlebot away from declared content. Those two fixes will address the crawling and indexing problems causing your ranking gaps.


FAQ

Q: How does CDN caching affect hreflang implementation?
A: CDNs cache page responses. If your geo-IP detection happens at the origin server behind a CDN, the CDN might cache a response for one location and serve it to users from other locations. This breaks the connection between user location and appropriate content.

Q: Should I disable geo-redirects for Googlebot?
A: Yes, or configure them carefully. Googlebot crawls from US IPs and should see the content declared in hreflang without being redirected to a different version. Serving Googlebot the declared content while using geo-detection for users is acceptable if the content matches what target users would see.

Q: Does Google crawl from different countries to see localized content?
A: Generally no. Google primarily crawls from US-based data centers. It relies on hreflang declarations to understand international page relationships and crawls the declared URLs to see each version. It doesn’t simulate being in France to see French content.

Q: How do I vary CDN cache by user location?
A: Most CDNs offer cache key customization. In Cloudflare, use Cache Rules to vary by country or configure the Vary header appropriately. This creates separate cache entries for each country, ensuring location-appropriate content is served from cache.


Summary

CDN caching can break international SEO when geo-IP detection happens at the origin server but the CDN caches responses without location awareness. Users may receive cached content intended for a different country.

Configure your CDN to vary cache by country so each geographic segment gets appropriate cached content. This increases cache storage but ensures correct content delivery.

Hreflang URLs must serve declared content regardless of who accesses them. If Googlebot crawling from the US gets redirected away from your French URL, your hreflang implementation fails.

Google primarily crawls from the US and relies on hreflang declarations to understand international versions. It crawls the declared alternate URLs to index each version, not by simulating location.

Test international setup by using URL Inspection and VPNs to verify that users and search engines see the content you intend for each market.


Sources

  • Google Search Central: Hreflang implementation
  • Google Search Central: International targeting
  • Cloudflare: Cache rules documentation