Diagnose a wrong-language page served from a CDN cache
An English visitor opens a public schedule and sees the Spanish page, then a reload shows English. That looks like a CDN cache mix-up, but the origin may have selected a different language, a cookie may have overridden a browser preference, or the URLs may not be equivalent. Use four controlled requests to locate the first wrong response before changing a cache rule.
Boletolibre editorial team
Published
Capture the wrong page without changing the cache
Save the exact public URL, path, safe query-parameter names, time and time zone, expected language, visible heading and actual language. Note whether the page is public and signed-out; do not collect attendee tokens or account cookies in a shared sheet. Capture the response status and any visible cache diagnostic header, but treat a browser reload as another observation rather than proof that caching caused the first response. A different URL, redirect target or signed-in state can legitimately produce a different representation. Ask the content owner which two language versions are approved before testing; otherwise a stale translation may be mistaken for a wrong-language response.[1]
For an owner-approved public test, use the same final URL with a known request language preference and no site language cookie, then repeat with the other preference. Preserve the exact `Accept-Language` values and whether any locale cookie was sent, but redact private cookie values. Do not add a random cache-busting query string: it changes the request target and may create a different cache entry. A tool or browser profile that can set a known language preference is useful; a normal browser's full language list can include several weighted alternatives. Keep the request method, URL and other relevant state fixed when comparing the two outcomes.[2][3]
Identify what selects the page language
Find the site's real selector before discussing `Vary`. Some sites use separate language paths such as `/en/program` and `/es/program`; those are different target URIs. Others return different languages from one URL according to `Accept-Language`, a locale cookie, a redirect or an account setting. RFC 9110 defines `Accept-Language` as a list of preferred languages, not a command that every server must obey. Record the request preference, final URL after redirects and visible language for each trial. If the origin intentionally returns the same default language for both requests, a cache cannot be blamed for not creating two translations it never received.[1][2]
A cookie-selected page is a different branch from header negotiation. `Vary: Accept-Language` describes a choice based on that request header; it does not say a CDN automatically keys on a locale cookie. A broad `Vary: Cookie` or custom cookie key has cache and privacy consequences that depend on the provider and the content. Ask the site and cache owners whether public HTML is shared, separately keyed by a known safe locale value, or excluded from shared caching. Never assume that a cookie varies the cache merely because it exists in the browser. If signed-in or attendee-specific material is present, involve the responsible owner before changing any shared-cache policy.[2][3]
Compare two origin and two edge responses
Use the four-row comparison table on a harmless public page. Compare the same page route under equivalent host-routing conditions: make two requests through an operator-approved origin-side method with controlled language preferences, then two through the public CDN edge with the same preferences and cookie state. Record each requested and final URL; an origin method may use a different network address, so a changed Host, redirect or route makes the responses non-comparable. Do not bypass access controls or invent an origin URL. Record the requested preference, selected language in visible content, response `Vary`, and a provider-specific cache indicator if available. The table records a test design, not a claim that every site can expose an origin route to readers.[1][3]
Read the result by the first mismatch. If origin English and Spanish requests already return the same wrong language, examine origin selection, redirects and translation publication. If origin variants differ correctly but the edge returns one variant for both controlled requests, the edge's variant selection becomes a strong lead. If only the first request after a locale cookie differs, repeat with the cookie state explicitly separated instead of changing `Accept-Language`. A cache-status label or `Age` value can help locate reuse, but neither alone proves which input selected the representation. Ask the CDN owner for the exact rule and cache key applied to this URL. On Cloudflare, configured normalization may send a normalized `Accept-Language` to the origin on a miss or revalidation. A direct-origin test with the raw browser header may therefore select a different origin variant; ask what the origin actually received through the edge.[3][5][6]
| Check | Path and request state | Record |
|---|---|---|
| 1 — origin A | Same page route/Host routing; `Accept-Language: en`; no locale cookie | Visible language, `Vary`, response ID/time |
| 2 — origin B | Same page route/Host routing; `Accept-Language: es`; no locale cookie | Visible language, `Vary`, response ID/time |
| 3 — edge A | Same final URL; `Accept-Language: en`; no locale cookie | Visible language, cache indicator, `Vary` |
| 4 — edge B | Same final URL; `Accept-Language: es`; no locale cookie | Visible language, cache indicator, `Vary` |
Read Vary and the provider cache rule separately
RFC 9110 says a response `Vary` field names request headers that might have influenced the representation. When the origin chooses a cacheable page by `Accept-Language`, `Vary: Accept-Language` tells conforming HTTP caches that those header values matter. RFC 9111 says a cache must not reuse such a stored response without revalidation for a later request whose nominated values do not match. Check that the header is present on each relevant response, including the default-language response; a missing `Vary` there can permit an over-broad reuse. This is the standards behavior, not a promise that a particular CDN's configured rule or custom key acts exactly as assumed.[2][3]
Inspect the CDN configuration as a separate piece of evidence. Cloudflare, for example, documents options to include selected header values, cookies or a derived language field in a custom cache key; those are Cloudflare features, not universal defaults or an instruction to enable them blindly. A provider might normalize language preferences, use URL paths, honor `Vary`, apply another rule or not cache the HTML at all. Record the actual provider rule, scope and precedence for the affected path. If its key ignores a selector that the origin uses, the owner can design a bounded variant strategy; if the key is already correct, look for stale objects, inconsistent origin headers or a different source of the wrong page. Cloudflare's `lang` field uses the first language code in `Accept-Language`; check that this key matches the origin's actual selection when several weighted languages are present.[5][6][3]
Cloudflare now documents three configured Vary actions for `accept-language`: `normalize`, `passthrough`, and `bypass`. The action alone does not create cached language variants: the cacheable origin response must also contain `Vary: Accept-Language`. Normalization can reorder preferences by quality, remove region variants and parameters, and apply an optional language allowlist; it may also forward that normalized value to origin even when the eventual response omits `Vary`. Passthrough uses the raw header; bypass does not store a response that varies on that header. Compare this action and value with the origin’s actual language choice. If the origin sends `Vary: *`, Cloudflare bypasses storage; a cached edge hit is not the expected explanation for that response.[6][5]
Choose one scoped correction for the proven selector
Choose a single fix that matches the proven selector. For distinct language paths, correct route or redirect mapping if the wrong path is selected. For a same-URL public response negotiated by `Accept-Language`, align the origin's `Vary` response and the CDN's documented variant behavior; test the default response too. For a cookie-selected language, agree on an explicit, limited cookie-aware strategy or keep the response out of shared caching. RFC 9111's `private` directive is one standards-based way to prevent a shared cache from storing a response, but whether it fits this site depends on the actual content and traffic. Do not add a header or purge all pages as a substitute for identifying the selector.[2][3][5][4][6]
Write down the owner, exact URL pattern, expected two language outcomes, intended cache behavior, change time and rollback condition. Apply the change only to the verified public route or template, then use a provider-supported URL-scoped invalidation if an old object must be removed. Avoid a global purge during an active ticket launch without a coordinated reason. A change that prevents wrong-language reuse but unexpectedly disables caching for every public page has a performance cost; one that preserves cache hits but mixes translations has a visitor cost. The owner should decide the acceptable boundary and measure both correct language and reuse after the change. On Cloudflare, changing Vary configuration does not purge old objects. If stale objects are confirmed, a URL-targeted purge covers all cached variants of that URL; this is a provider-specific follow-up, not a reason for a site-wide purge.[3][6]
Retest both languages and preserve the handoff
Repeat the same four requests after the change, then swap their order so neither language succeeds only because it was tested first. Check the final URL, visible title and key schedule facts, response `Vary`, and the provider's cache evidence for both language preferences. If the problem was reported from another edge location, ask the provider for a comparable observation there; a local clean result does not prove global recovery. Do not put private cookie values, ticket links or personal content into the public worksheet. Record any remaining uncertainty, including origin access that was unavailable or cache behavior inferred only from a vendor label.[3][5]
Hand the team a short result: selector used for this route, origin outcomes, edge outcomes, exact rule changed, before/after samples, and who will recheck after the next content update. If origin and edge are both correct but a particular browser remains wrong, investigate its language setting, locale cookie or local cache with that owner's consent; a CDN change would not follow from those observations. If a public page contains user-specific information, pause this public-page workflow and ask the site's privacy and cache owner to review the response before continuing. The goal is a repeatable route to the correct language, not a claim that `Vary` alone fixes every multilingual site.[2][3]
Download the editable four-request language-cache worksheet (Markdown)
Sources and further reading
- RFC 9110 §12.5.4: Accept-LanguageRFC Editor · Accessed
- RFC 9110 §12.5.5: VaryRFC Editor · Accessed
- RFC 9111 §4.1: Calculating Cache Keys with VaryRFC Editor · Accessed
- RFC 9111 §5.2.2.7: privateRFC Editor · Accessed
- Cache KeysCloudflare · Accessed
- VaryCloudflare · Accessed