Vary Support Lands in Cloudflare Cache Rules With Normalize, Passthrough, Bypass

Vary gets guardrails in Cloudflare Cache Rules: normalize, passthrough, or bypass headers to keep caches warm.
Isometric render of a CDN cache key vault with URLs splitting into response tiles, illustrating Cloudflare cache rules with normalize, passthrough, and bypass.
Visualizing Cloudflare cache rules for normalize, passthrough, and bypass routing. By Andres SEO Expert.

Key Takeaways

  • Vary support is now live in Cloudflare Cache Rules across Free, Pro, Business, and Enterprise plans.
  • Normalize, passthrough, and bypass let operators decide how declared request headers shape cache keys instead of comparing raw values.
  • Unlike Cloud CDN’s fixed Vary allowlist, Cloudflare lets teams tune policy per header, with query-string stability as the next frontier.

The Ugliest Part of HTTP Just Got Operable Guardrails

Cloudflare’s official engineering channel confirms that Vary support is now live in Cache Rules across Free, Pro, Business, and Enterprise plans.

The HTTP response header has long been one of the most dangerous mechanisms in shared caching: it prevents wrong-byte delivery, but it can also shatter a cache into thousands of single-use variants.

The new controls give operators a way to decide how much variation actually matters, instead of leaving the cache to compare raw request headers.

How Normalize, Passthrough, and Bypass Rebuild Cache Coherence

According to Cloudflare’s engineering blog, Vary works by telling an intermediary cache which request fields may affect the response an origin produces.

One URL can return HTML to a browser expecting markup and JSON to an API client, with the response selected by the ‘Accept’ header.

Without Vary, whichever representation enters the cache first can be served to both clients.

With Vary, the cache learns that the URL alone is not enough, but it still does not learn which differences are semantically important.

  • normalize — Reduces equivalent request headers to a shared key before cache matching, with special handling for ‘Accept’, ‘Accept-Language’, and ‘Accept-Encoding’.
  • passthrough — Preserves exact casing, whitespace, ordering, and duplicate values for cache keys when the precise value changes the response.
  • bypass — Keeps responses out of cache for high-cardinality or personalized headers such as ‘Cookie’ or ‘User-Agent’.

Two requests can both prefer English, but carry different language tag orders, quality values, or casing.

A cache that treats raw values as distinct may store identical response bytes in separate entries.

Ten possible values across three headers can create 1,000 combinations, and real headers such as ‘User-Agent’ or ‘Cookie’ can have far higher cardinality.

An analysis of more than 120 million responses from nearly 50,000 popular sites found almost 3,000 sites varying on four or more fields.

Some sites varied on 10, 23, or even 47 fields, turning a technically correct cache into a nearly permanently cold one.

The origin still returns ‘Vary: Accept, Accept-Language’.

Cloudflare then reads the stored Vary fields and applies the configured action to the corresponding request headers.

If normalization was configured, Cloudflare can group several raw values under one cache key and forward the normalized value to the origin before the response is selected.

This ordering keeps the origin’s response selection aligned with the cache key.

If the response omits Vary, Cloudflare caches it normally; if ‘Vary: *’ appears, Cloudflare always bypasses cache.

Changing a Vary configuration does not automatically purge existing variants.

Old entries remain until expiry or purge, while new requests refill under the new keys.

A custom cache key adds dimensions to every response covered by a rule, whether the origin used them or not.

Vary is response-driven: the origin declares which headers matter, and the cache rule decides how to handle each declared field.

Cloudflare’s guidance is to use a custom cache key when a request property always defines the resource, and Vary when the origin names a consistent set of fields.

Where Cloudflare’s Vary Controls Sit in the Wider CDN Landscape

Google Cloud’s CDN documentation shows a different operational boundary.

Cloud CDN respects Vary only for a fixed allowlist of headers, including ‘Accept’, ‘Accept-Encoding’, ‘Origin’, and several ‘Sec-Fetch’ fields.

A response with any other Vary value, even under ‘FORCE_CACHE_ALL’, is simply not cached.

Cloudflare’s design does not force that kind of allowlist; it lets operators apply normalize, passthrough, or bypass to any header the origin names.

The contrast exposes a fundamental strategic decision for CDN providers: hard-code a safe set of negotiation fields, or ship guardrails and let operators tune the policy to their own application.

An IETF draft for ‘No-Vary-Search’ points to the next phase of this problem: extending the same stability to query strings.

The draft defines a response header that lets origins declare which URL query parameters do not affect the served response, so shared caches can ignore tracking parameters during matching.

It explicitly operates in addition to Vary, not as a replacement.

The proposal also warns that incorrectly marking a personalized or authorization parameter as no-vary could cause shared caches to serve one user’s response to another.

Cloudflare’s current Vary controls push in a similar direction by keeping the origin’s declaration and the operator’s cache policy tightly coupled.

The engineering team has also indicated it is evaluating ideas from the expired Availability Hints draft, which could let origins describe their supported representations directly and reduce manual media type and language configuration.

A Cache Key That Finally Matches the Origin’s Intent

Cloudflare’s Vary controls remove the long-standing false choice between serving the right response and maintaining a warm cache, giving performance teams a direct lever over negotiation fragmentation. For teams operating high-cardinality cache policies on WordPress infrastructure, WordPress speed engineering is how Andres SEO Expert approaches it — contact us.

Frequently Asked Questions

What is Cloudflare Vary support in Cache Rules?

Cloudflare Vary support in Cache Rules is a live feature across Free, Pro, Business, and Enterprise plans that gives operators control over how the Vary response header affects shared caching. Instead of letting the cache compare raw request headers, teams can apply normalize, passthrough, or bypass actions to the fields an origin declares.

What do normalize, passthrough, and bypass do for Vary?

Normalize reduces equivalent request headers to a shared cache key, with special handling for Accept, Accept-Language, and Accept-Encoding. Passthrough preserves exact casing, whitespace, ordering, and duplicate values when precise values change the response. Bypass keeps responses out of cache for high-cardinality or personalized headers such as Cookie or User-Agent.

Why can Vary cause cache fragmentation?

Vary prevents wrong-byte delivery, but raw header comparison can shatter a cache into many single-use variants. Two requests may prefer English but carry different language tag orders, quality values, or casing, creating separate entries for identical response bytes. Ten values across three headers can create 1,000 combinations, and User-Agent or Cookie can have far higher cardinality.

How does Cloudflare process Vary fields from the origin?

The origin returns Vary fields such as Vary: Accept, Accept-Language. Cloudflare reads the stored Vary fields and applies the configured action to the corresponding request headers. If normalization is configured, Cloudflare can group several raw values under one cache key and forward the normalized value to the origin before the response is selected.

What happens if Vary is missing or set to Vary: *?

If the response omits Vary, Cloudflare caches it normally. If Vary: * appears, Cloudflare always bypasses cache. This ensures that responses declaring every request field as potentially significant are not stored in shared cache.

Does changing Vary configuration purge existing cached variants?

No. Changing a Vary configuration does not automatically purge existing variants. Old entries remain until expiry or purge, while new requests refill under the new cache keys.

How is Vary different from a custom cache key?

A custom cache key adds dimensions to every response covered by a rule, whether the origin used them or not. Vary is response-driven: the origin declares which headers matter, and the cache rule decides how to handle each declared field. Cloudflare recommends a custom cache key when a request property always defines the resource, and Vary when the origin names a consistent set of fields.

How does Cloudflare’s Vary approach compare with Google Cloud CDN and IETF No-Vary-Search?

Google Cloud CDN respects Vary only for a fixed allowlist including Accept, Accept-Encoding, Origin, and several Sec-Fetch fields; other Vary values are not cached even under FORCE_CACHE_ALL. Cloudflare lets operators apply normalize, passthrough, or bypass to any header the origin names. The IETF No-Vary-Search draft extends similar stability to query strings and operates in addition to Vary.

Prev Next

Subscribe to My Newsletter

Subscribe to my email newsletter to get the latest posts delivered right to your email. Pure inspiration, zero spam.
You agree to the Terms of Use and Privacy Policy