An exporter's German page starts appearing in Google as the Turkish version, and buyers in Germany land on the wrong language. The engineering team insists the server is correct, yet a single response cached at the CDN layer may be serving the same content to every language. This scenario (a hypothetical example) shows that many hreflang problems begin not in the HTML tag itself but in the delivery layer behind it. If the basic logic is new to you, start with our pillar guide on what hreflang is; this article builds on that foundation.
Key Takeaways
- Even when hreflang tags are correct, a CDN or cache can make Google and users see different versions of a page.
- The Vary header tells caches which request header to key separate copies on; a missing or wrong value spreads the wrong language.
- Content negotiation with Accept-Language is technically possible, but it reduces predictability for caches and crawlers.
- A separate, stable URL for each language simplifies both the cache key and the hreflang signal for most export sites.
- Exact behavior depends on your CDN provider and server setup, so verify every change against live responses.
Why is this problem so easy to miss?
hreflang tells search engines how pages covering the same content in different languages and regions relate to one another. Google's documentation for multilingual and multi-regional sites describes the markup using a language code and an optional region code, asks that each page in a cluster reference itself, and requires return links between pages. The annotations can be delivered in the HTML head, in HTTP headers, or through a sitemap. Read the current Google text for your own project; here we only summarize it.
The catch is that correct markup in the source does not guarantee that the right page reaches the user. A CDN or browser cache sitting between the origin and the visitor can return a response saved earlier for the same URL, and that response may belong to another language. The team cannot see this in the code, because the code is correct. Only the distributed system is serving the wrong version.
That is why hreflang problems are hard to close with a single fix. A team that corrects tags for a week and then watches the issue come back is usually dealing with a mismatch between cache decisions and page variants, not a broken tag.
Two separate layers: content and delivery
In practice, it helps to separate two kinds of problems. The first is the content signal: whether each page links to its counterparts, whether every version declares its own language, and whether return links are complete. The second is the delivery signal: whether the response differs depending on who asks, and whether that difference is stored under the right key in the cache. You find the first kind with Search Console and an hreflang audit tool. The second needs a look at response headers and cache behavior. This article focuses on the second layer.
Misdiagnosis happens most often here. When a team says "our hreflang is broken," the real cause may be that one cached version is being shown to everyone. The first step is therefore to request the same URL with different headers and compare the responses. If they match, the issue is most likely on the content side. If they differ, look at the delivery layer.
What does the Vary header do?
The HTTP Vary response header tells caches which request headers the server considered when choosing a response. Under RFC 9110, a cache must compare the values of the listed request headers before it reuses a stored response. A response with Vary: Accept-Language therefore signals that Turkish and English requests need separate entries.
The mechanism cuts both ways. If Vary is missing while the server picks a language from the header, the cache can hand one language to everyone. If Vary lists too much, cache keys fragment and the hit rate drops. Vary: * means the response cannot be stored for reuse at all, which in practice turns caching off for that resource.
Comparing common Vary values
| Response header | General cache behavior | hreflang risk |
|---|---|---|
| No Vary | One entry per URL | If the server picks a language from headers, the wrong version can spread |
| Vary: Accept-Language | Separate entry per language | Sound when it works; coverage and crawler behavior can stay hard to predict |
| Vary: Cookie | Separate entry per cookie value | Personal cookies can fragment the cache badly |
| Vary: * | Effectively not cached | Performance loss; the language signal still reaches the origin on every request |
This table summarizes general behavior. Vary support, the headers a provider includes in its cache key, and how long entries live all vary by provider. Test in your own environment before you decide anything.
Risks of Accept-Language content negotiation
Content negotiation, meaning the server reads the browser's Accept-Language header and picks a language automatically, is technically feasible. Combined with hreflang, though, it introduces several risks:
- Inconsistent crawling: A search engine may not request each URL with the same Accept-Language value, so the version it sees can differ from what you assume. Having each URL return its own fixed content is sturdier than relying on automatic language selection.
- Cache fragmentation: When each language variant becomes its own cache entry, CDN hit rates fall and revalidation requests grow. That cost shows up as load and latency.
- Unverifiable results: A user who shares a link may open it and see another language. The fixed correspondence that hreflang expects breaks, and it becomes hard for a team to reproduce a reported bug.
- Restricting language choice: Automatic redirects based on language can take away a visitor's ability to pick their own language. Google's multilingual site guidance suggests offering users a choice rather than redirecting them automatically; check the current text yourself.
In short, Accept-Language based negotiation is an architectural decision, not just a technical option. If you choose it, you have to plan Vary, the cache key and crawler behavior together. Systems built without that planning often fail at the first traffic spike.
How does the wrong language get cached?
Consider a general scenario (a hypothetical example). The first request comes from a browser that prefers German and lands on the root address. The server returns the German version. The response has no Vary header, so it is cached. The next request, this time for a Turkish visitor, reaches the same address, finds the cached entry, and shows German content. This can happen without any code change; request order and cache lifetime are enough.
A similar result follows when the server does send a Vary header but the CDN does not include that header in its cache key. Here we do not give a specific product setting. Check your provider's documentation for which headers form the cache key and whether Vary is honored. Note that the information is sometimes split across several layers (browser, CDN, origin cache), so confirm each one.
Another common case is a long cache lifetime that delays content updates. That is a freshness problem rather than a language problem, but when a user sees the wrong language, the two can look identical. Read the response age and cache headers together when you diagnose it.
Why is URL-based separation more predictable?
Google's general direction is to give each language and region version its own stable URL. For example, a root address for the default language and separate paths such as /de/ and /en/, each returning the same content every time. In that setup the cache key is the URL alone, so every language gets its own entry without any Vary header. The hreflang annotations also attach to fixed URL identities.
Separate URL per language: pros and cons
- Pro: Cache behavior becomes predictable, and language can be verified by opening a link.
- Pro: hreflang relationships attach to stable URLs, which makes audits and debugging easier.
- Con: Content, maintenance and translation work grows with every language.
- Con: Changing the language structure later means URL migration and redirect work.
When you decide whether this structure fits, the checklist in our international SEO guide on hreflang errors makes the work easier. We cover return tag problems separately in our return tag errors article; the two issues usually need to be solved together.
Checklist: verifying hreflang at the CDN and cache layer
Apply these steps to real responses. Reading the source alone is not enough.
- Request the same URL with different Accept-Language values and record the language returned.
- Note the Vary and Cache-Control values in the response headers.
- Confirm in your provider's documentation which headers form the cache key.
- Check that every hreflang target URL returns 200 and contains its own language annotation.
- Use an audit tool to confirm that return links are reciprocal.
- Keep a procedure for purging the cache entry when a language version changes.
- For x-default, see our x-default guide and separate the selector page from the default version.
Running this list after every cache or deployment change works better than running it after every article. That way you can tell which change triggered a problem.
Uncertainties: what do we not know for sure?
Presenting everything here as settled would be misleading. The known and uncertain points are these:
- The Accept-Language values Googlebot sends are not fixed, so do not design around a specific value.
- Cache behavior depends on the CDN provider, plan and configuration, and general rules may not hold exactly in every environment.
- Which version a search result shows depends on several signals combined, not a single one. hreflang is a hint, not a forced redirect.
Symptom, cause and first check
| Symptom | Likely cause | First check |
|---|---|---|
| Wrong language in search results | hreflang missing or no self-reference | Read the alternate tags in the page source |
| Users see the wrong language | Wrong variant in cache | Compare responses for different Accept-Language values |
| Content does not update after a language change | Stale cache entry | Check purge behavior and response age |
Conclusion and next step
Problems with hreflang in CDN and cache layers usually come from delivery decisions more than from the tag itself. Understanding Vary correctly, seeing the risks of Accept-Language negotiation, and taking advantage of URL-based separation for most export sites reduces the problem at its source. If you want to see how script codes such as zh-Hans and zh-Hant are used in the language attribute, our article on script codes in hreflang covers that next.
As a next step, pick the three highest-traffic pages this week. Request each one with two different language headers, compare the responses, and record the Vary values in a table. Reproduce those records in a test environment before any broad change in production. This article is a technical guide; it does not promise any result, timeline or performance gain.




No comments yet
Leave a Comment