A page looks right in a browser, but visitors behind the CDN sometimes receive another market’s language. Or a mobile request gets HTML selected for desktop. In those cases, the application is only part of the path. The cache also has to choose the representation that matches the request.
The HTTP Vary response header describes which request headers might have influenced the choice of a response. That matters to a cache: a stored German response should not simply satisfy an English request if the origin selected it using Accept-Language. Vary is not an SEO switch. It does not create extra URLs, connect language versions with hreflang or guarantee that Google will crawl or index every representation.
What Vary tells a cache
An HTTP cache needs a key to associate a stored response with a later request. At a minimum, it uses the request method and target URI. When the origin also selects a representation using a request header, Vary can tell intermediary caches that this input matters.
RFC 9110, section 12.5.5, defines the header’s semantics. An origin might return Vary: Accept-Language when it chooses a response based on a language preference. RFC 9111, section 4.1, describes reuse: without revalidation, a cache must not use a stored response with Vary for a request whose nominated header fields do not match those in the original request. In practical terms, Vary adds conditions to the cache-key match.
A simple case looks like this:
httpRequest: Accept-Language: de
Response: German HTML
Response header: Vary: Accept-Language
Request: Accept-Language: en
Expected: English HTML or a new request to the origin
Matching the URL alone is not enough. The values nominated by Vary must also match, or the response must be validated. If the default response omits Vary, a cache can choose that representation for other requests even when they express a different preference. Test the response returned when no language or device preference is sent. Omitting Vary from that default response is an easy gap to miss.
Vary: * is a special case. It is not a list of extra cache-key fields: under RFC 9111, a stored response with this value never matches through the normal header comparison. If you encounter it, check whether the origin intends to prevent reuse and whether the response is being validated instead. It does not reveal how a CDN has configured its own cache key.
Vary does not describe the internal cache key used by a particular CDN vendor. RFC 9111 describes HTTP cache behavior. An edge platform can also apply its own rules, transformations or custom cache keys. If a platform removes a header or does not include the relevant value in its configured cache selection, you cannot infer correct edge separation from the origin response alone. The useful evidence is the response visitors receive from the public host, together with the effective cache-key configuration.
Language and device variants are different
For language selection, Accept-Language can influence the response. A browser may send a list of preferred languages. The application can choose a language from it or fall back to a default. If the same URL returns different HTML, the origin and cache both need to account for the selection rule.
Google documents a limitation of locale-adaptive pages. Googlebot’s default IP addresses appear to be based in the US, and the documented requests do not set Accept-Language. Google also describes geo-distributed crawling. That does not mean Google crawls only from the US or will always miss other versions. It does mean that a representation available only through a browser-language preference or perceived location is not a dependable replacement for discoverable URLs for each language.
Google recommends separate URLs for language versions and hreflang annotations. With separate URLs, each version can be requested directly, linked internally, listed in a sitemap and connected to its alternatives. A single URL selected only by Accept-Language has no distinct URL that clearly represents each language. Read Google’s localized page guidance and technical SEO overview before choosing the URL architecture. Google’s full localized-version documentation explains the supported hreflang methods.
Crawl access and cache selection are also separate questions: a robots.txt rule can block a crawl path, but it does not choose a language representation in the cache. Check it separately using the robots.txt guide.
Device selection is a separate question. A responsive site can look different at different screen widths while returning the same HTML. In that case, the origin may not be selecting a representation by User-Agent, so Vary: User-Agent is not automatically needed. Dynamic serving can use one URL and select different HTML based on the user agent. Google names Vary: User-Agent for that configuration. The header should reflect the selection the server actually performs, not be added to every page by default.
Google recommends responsive design as the easiest pattern to implement and maintain. With dynamic serving, the mobile HTML still needs to be reliably selected and delivered to Google’s smartphone crawler. The header signals the variation to caches. It does not replace a complete mobile representation or a check of what Google actually receives. Separate desktop and mobile URLs also have their own URL mapping and canonical requirements.
A cache problem can look like an SEO problem
Imagine a page at /products/ where the origin chooses HTML based on Accept-Language. A request with de fills the edge cache. Later, a visitor requests the same URL with en. If the edge configuration puts both requests under the same key, or handles the relevant values differently from what you expect, the English request may receive cached German HTML.
That can affect visitors, and it can affect the HTML a crawler receives at a particular time. Titles, copy, internal links and signals about the language offered may differ. You cannot infer a ranking loss from that observation alone. The immediate finding is that a response representation may have been reused for a request that expected another one. Compare the responses and cache states before deciding which part of the path is responsible.
The same diagnostic idea applies to User-Agent variants, but do not assume that every mobile layout is a separate HTTP representation. If CSS only rearranges the page while the server sends the same HTML, that is not the same as dynamic serving with different HTML. Compare status, headers and response body instead of inferring a different cache representation from a different screenshot.
Vary is not 304
Vary and 304 Not Modified can occur in the same cache path, but they do different jobs. Vary helps identify which stored representation can satisfy a request. A 304 response can validate a previously stored representation for a conditional request using a validator such as ETag or Last-Modified. During revalidation, a 304 can be applied only to a stored response that matches the URI, method and Vary conditions; it does not provide a new response body.
If a cache stored or selected the wrong language representation, a 304 does not repair that choice. A valid 304 may let the cache reuse an existing body, but it does not by itself establish that the body matches the language or device request. When comparing this issue with canonical changes during hydration, keep the layers separate too: a canonical describes a preferred URL for search systems, while Vary describes response selection in an HTTP cache.
Test the response at the edge
A useful test compares the same URL with different request headers. Use a test page or a safe, non-personalized URL. Record whether the cache is cold or warm, which request ran first and whether you contacted the origin directly or the public CDN.
For example:
bashcurl -sS -D de.headers -o de.html \
-H 'Accept-Language: de' https://example.com/path/
curl -sS -D en.headers -o en.html \
-H 'Accept-Language: en' https://example.com/path/
Compare the status, Vary, Cache-Control, Age and any cache-status headers available. X-Cache is not a universal standard; its meaning depends on the provider. Also compare a body hash or visible, language-specific text in the response. A changed header with identical HTML does not prove language variation. Different HTML without an appropriate cache distinction is a reason to inspect the effective cache-key rule.
Repeat requests in alternating order. If the German request runs first and the English request second, a cache key that is too broad may become visible. Repeat the sequence with the opposite order. Also inspect the response without Accept-Language. The default representation belongs in the same test because it may otherwise be reused for a request with a preference.
A client-side Cache-Control: no-cache request header does not prove that every CDN platform bypasses its edge cache. A reliable origin test needs the provider’s documented bypass, a test environment or a controlled request directly to the origin. Record whether cookies, geolocation or device detection also influence the response. If the language comes from a cookie, Accept-Language is not the only selection rule. If the cache key includes additional attributes, document that effective rule too.
For User-Agent variants, compare the same URL with representative desktop and smartphone user agents, both at origin and edge, then inspect the response body and cache status. Treat this as a representation test, not proof that you contacted a real Googlebot. User-Agent strings are easy to imitate. To identify Googlebot traffic, use server logs and a verifiable bot identity, not just a header value. With responsive HTML, establish whether the response body changes at all or whether only the browser’s rendering changes.
A repair sequence
- Name the selection rule. Write down which request property changes the response: Accept-Language, User-Agent, a cookie, region or a combination. If the team cannot name it, Vary may not be the root cause.
- Check both origin responses. Request the same URL with each relevant variation and save the headers and HTML. Also check the default response without a selection preference. A single request cannot prove the variant behavior.
- Test the public edge separately. Repeat through the public host, first with an empty or bypassed cache and then with a warm cache. Compare the body, Age and provider-specific cache-status headers. An edge hit only shows that the cache served a response, not that it served the right one.
- Inspect the effective cache-key configuration. Compare Vary values with the CDN rules. Check normalization, removal or rewriting of headers, and the default response. For language, splitting on raw Accept-Language strings may be more granular than the application’s actual language selection. Any normalized language group still needs to match the origin’s selection logic.
- Choose the right information architecture. For localized content, separate URLs with reciprocal hreflang are usually clearer than one URL whose language depends on browser preference. Check that canonical targets, visible language links and page text agree. For device variants, determine whether responsive design returns the same content for each device or dynamic serving intentionally sends different HTML.
- Retest the fix with the same matrix. Repeat cold and warm tests in both request orders. Confirm that the public host returns a response that fits the request and that edge caches continue to reuse the correct variant. Test browser caches separately if they are part of the incident. Purging cached responses can remove old entries, but it does not fix a broken key rule.
Teams can combine the Google Search Console overview with verified server logs. The report is not a substitute for a CDN reproduction test and does not identify a faulty cache rule by itself. A technical Site Audit workflow can help record affected URL patterns and compare results using the same test matrix. An SEO audit can also help distinguish one visible case from a recurring issue across multiple page templates.
What the test proves
If both language requests reach the expected response at the origin but the warm edge returns one language for both, that points to a difference between the origin and cache path. Confirm the effective cache-key rule before assigning a cause. If the origin itself returns the wrong language, the selection problem is earlier in the stack. If the edge returns a different correct representation for each request, that still does not prove which one Google receives on a later crawl.
A correct Vary setup reduces the chance that a conforming cache reuses a stored response for a request with different nominated headers. It does not confirm that every intermediary uses the same configuration, and it does not establish that Google can find every locale-adaptive version. Keep three SEO questions separate: what response the public host returns, what URL a crawler can discover, and which URL is selected for Search. HTTP headers, internal links, hreflang and Search Console data each answer only part of that picture.