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 Cache Everything while ignoring query strings: A Guide for Website Owners

Learn when Cloudflare can ignore query strings in a cache key, how to create the rule, and how to avoid serving the wrong cached variant.

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 configure Cloudflare Cache Everything while ignoring query strings, create a Cache Rule for the desired hostname, set Cache eligibility to Eligible for cache, and set Cache key → Query string to Ignore query string. Use this only when URLs that differ after ? should return the same content. If a query parameter changes the page or response, ignoring it can cause the wrong cached variant to be reused.

What the setting changes#

Cloudflare’s Cache Rules let website owners decide which requests are eligible for caching and configure how Cloudflare identifies cached responses. In this setup, the query string is ignored when Cloudflare builds the cache key for matching requests.

The rule makes matching requests eligible for caching; it does not guarantee that every response will be cached. Cloudflare describes its Cache product as storing copies of content and provides rules for specifying which resources should be cached and for how long. See Cloudflare’s Cache Rule example and the Cloudflare Cache documentation.

Create the rule in Cloudflare#

  1. Create a Cache Rule in Cloudflare.
  2. Match the desired hostname. For a hostname such as example.com, Cloudflare’s documented example uses either:
  • Expression Builder: Hostname contains "example.com"
  • Expression Editor: (http.host contains "example.com")
  1. Set Cache eligibility to Eligible for cache.
  2. Under Cache key, set Query string to Ignore query string.

Check whether it is appropriate#

Use this configuration when the query string is irrelevant to the content. Do not apply it to requests where a parameter controls pagination, filtering, language, personalization, experiments, or another response variant. Those URLs may need separate cache entries.

Before relying on the rule, review the query parameters used by your site and determine whether changing each one changes the response. Testing representative URLs with different query strings can confirm whether they are intended to serve the same content; that test checks your site’s behavior and is not a guarantee that every response will be cached.

Sources

  1. Cloudflare: Cache Everything while ignoring query strings Checked 2026-11-18
  2. Cloudflare Cache documentation Checked 2026-11-18