Advertising disclosure: We may earn a commission from links on this site. Commercial relationships can affect placement. Product facts, limitations, and source dates remain part of our editorial record.

How funding works
Web Hosting

Cloudflare Bypass Cache on Cookie: A Guide for Website Owners

Learn how Cloudflare Cache Rules can bypass cache for requests carrying a specific cookie, with the documented expression and a spelling caveat.

Review sources
Research standard

Facts that can change should include a source and check date. Benchmark claims should state the plan, region, method, and test period.

To make selected cookie-bearing requests skip Cloudflare’s cache, create a Cloudflare Cache Rule that matches both your hostname and the target cookie, then set Cache eligibility to Bypass cache. The documented example uses example.com and test-cookie; replace those sample values with your actual hostname and cookie name.

Configure the rule#

Cloudflare’s documented setup uses two matching conditions joined by AND:

Data table from this page
MatchExample
Hostname containsexample.com
Cookie containstest-cookie

Set the rule’s action to:

  • Cache eligibility: Bypass cache

Cloudflare shows these equivalent expressions:

Hostname contains "example.com" AND Cookie contains "test-cookie"
(http.host contains "example.com" and http.cookie contains "test-cookie")

The rule applies to requests only when both the hostname and cookie conditions match. It does not select every request for the hostname when the cookie condition is absent or different.

The example page’s introductory text refers to test_cookie with an underscore, while both rule expressions use test-cookie with a hyphen. Those are different cookie names. Replace the sample with your actual cookie name and use the same spelling everywhere in the rule.

What this controls#

Cloudflare describes its Cache as storing copies of website content across its network. Cloudflare Cache Rules let website owners specify which resources should be cached and for how long. This example changes cache eligibility to bypass caching for the requests selected by the hostname-and-cookie match.

The instructions are specific to Cloudflare Cache Rules. The supplied documentation describes the configuration, not a runtime result for your site, so verify that the hostname, cookie name, and Bypass cache action match your intended requests before relying on the rule.

Sources

  1. Cloudflare: Bypass Cache on Cookie Checked 2026-10-27
  2. Cloudflare cache documentation Checked 2026-10-27