Keep Cloudflare custom cache keys aligned with the URL sent to the origin

Consolidating keys can be unsafe when the origin still distinguishes the requests.

Resilient network core with engineered blue and gold data paths.
DSE visual intelligenceNetworks & infrastructureGuide · 2 min read
Executive summary

What you need to know

Consolidating keys can be unsafe when the origin still distinguishes the requests.

Potentially affected

This concerns Cloudflare request-derived custom cache keys.

DSE recommendation

DSE recommends listing every input that changes response content before removing it from the key.

Consolidating keys can be unsafe when the origin still distinguishes the requests.

Source facts

Cloudflare describes cache keys as identifiers derived from request properties. Custom keys can split one URL into variants or consolidate different requests, but may reduce hit rate through sharding. The source recommends enabling Normalize URLs to origin alongside URL normalization for custom-key designs so the keyed URL matches what the origin receives.

Source: Cloudflare — Cache Keys.

Applicability

This concerns Cloudflare request-derived custom cache keys.

DSE recommendation

DSE recommends listing every input that changes response content before removing it from the key. Keep personalization and authorization dimensions out of a public shared-cache design unless there is an explicitly reviewed architecture. Prefer a small meaningful key rather than including arbitrary high-cardinality headers. Review origin normalization and any rewritten paths together so two requests merged at the cache do not still produce different origin output. Create an equivalence table showing which pairs of requests may share output and which must remain separate. For each omitted dimension, require the application owner’s reason. Include the post-normalization origin URL in that table so the safety decision covers the request actually processed by the application.

Verification

In a controlled environment, compare requests intended to share content and requests intended to remain distinct. Inspect the final origin URL, content marker, and repeated-request cache behavior. Confirm the design cannot return one variant for another request and document the expected purge method for the chosen key dimensions.

Official reference

Cloudflare — Cache Keys. Reviewed October 20, 2026.

Primary reference

Review the official source

Cloudflare — Cache Keys · Verified October 20, 2026

Open official reference ↗
Plan the next step

Need help applying this guidance safely?

DSE can help confirm applicability, protect service continuity, and validate the result across physical security and IT systems.

Talk with DSE