From 5eb0a00769f80316fa052ab65edfbe31f2edfa70 Mon Sep 17 00:00:00 2001 From: J Evans Date: Mon, 18 May 2026 12:44:27 -0700 Subject: [PATCH] [Cache Rules] Document "is in list" and "is not in list" operators in rule expressions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Document the "is in list" and "is not in list" operators for Cache Rules. These operators allow Enterprise customers to match requests against custom hostname lists in cache rule expressions — for example, applying a caching configuration to all hostnames in a managed list rather than enumerating them individually. Changes: - **`settings.mdx`**: Add "is in list" / "is not in list" to the available operators list, with a note explaining they are available for the Hostname field on Enterprise plans and linking to the custom lists documentation. - **New example (`cache-by-hostname-list.mdx`)**: Add an example showing how to create a cache rule that caches everything for hostnames matching a custom hostname list, with both Expression Builder and Expression Editor syntax. Context: - **Jira**: [CACHE-11044](https://jira.cfdata.org/browse/CACHE-11044) - The corresponding dashboard change exposes the "is in list" operator in the cache rules expression builder for Enterprise zones. - Note: The custom lists documentation currently lives under `/waf/tools/lists/` despite being an account-level, product-agnostic feature used by 11+ products (WAF, DDoS, Network Firewall, Cloudflare One, etc.). A future effort could relocate it to a more neutral home like `/rules/` or `/ruleset-engine/`. - [ ] Is there a [changelog](https://developers.cloudflare.com/changelog/) entry ([guidelines](https://developers.cloudflare.com/style-guide/documentation-content-strategy/content-types/changelog/))? If you don't add one for something awesome and new (however small) — how will our customers find out? Changelogs are automatically posted to [RSS feeds](https://developers.cloudflare.com/fundamentals/new-features/available-rss-feeds/), the [Discord](https://discord.com/channels/595317990191398933/1040420029080018945), and [X](https://x.com/CFchangelog). - [x] The change adheres to the [documentation style guide](https://developers.cloudflare.com/style-guide/). - [ ] If a larger change - such as adding a new page- an issue has been opened in relation to any incorrect or out of date information that this PR fixes. - [x] Files which have changed name or location have been allocated [redirects](https://developers.cloudflare.com/pages/configuration/redirects/#per-file). --- .../examples/cache-by-hostname-list.mdx | 29 +++++++++++++++++++ .../cache/how-to/cache-rules/settings.mdx | 7 +++++ 2 files changed, 36 insertions(+) create mode 100644 src/content/docs/cache/how-to/cache-rules/examples/cache-by-hostname-list.mdx diff --git a/src/content/docs/cache/how-to/cache-rules/examples/cache-by-hostname-list.mdx b/src/content/docs/cache/how-to/cache-rules/examples/cache-by-hostname-list.mdx new file mode 100644 index 000000000000000..f1090e74e4f2f6b --- /dev/null +++ b/src/content/docs/cache/how-to/cache-rules/examples/cache-by-hostname-list.mdx @@ -0,0 +1,29 @@ +--- +pcx_content_type: example +summary: Cache everything for hostnames in a list +title: Cache everything for hostnames in a list +description: Cache everything for hostnames in a list +products: [cache-rules] +--- + +import { Example } from "~/components" + +[Create a cache rule](/cache/how-to/cache-rules/create-dashboard/) to cache everything for hostnames that match a [custom hostname list](/waf/tools/lists/custom-lists/#lists-with-hostnames): + + + +- **When incoming requests match**: Custom filter expression + - Using the Expression Builder:
+ `Hostname is in list "my_hostnames"` + - Using the Expression Editor:
+ `(http.host in $my_hostnames)` + +- **Then**: + - **Cache eligibility**: Eligible for cache + +
+ +:::note + +The **is in list** operator requires an Enterprise plan. You must first [create a hostname list](/waf/tools/lists/create-dashboard/) in your account before you can reference it in a cache rule expression. +::: diff --git a/src/content/docs/cache/how-to/cache-rules/settings.mdx b/src/content/docs/cache/how-to/cache-rules/settings.mdx index 325e0259940cbfd..3a800d2ec63a51b 100644 --- a/src/content/docs/cache/how-to/cache-rules/settings.mdx +++ b/src/content/docs/cache/how-to/cache-rules/settings.mdx @@ -59,12 +59,19 @@ The operators available for Cache Rule expressions are: - does not end with - is in - is not in +- is in list +- is not in list :::note Not all operators are available for every selected field. ::: +:::note + +The **is in list** and **is not in list** operators are available for the Hostname field on Enterprise plans. They allow you to match requests against [custom lists](/waf/tools/lists/custom-lists/) — for example, a hostname list containing all the domains you want to apply a particular caching configuration to. Refer to [Use lists in expressions](/waf/tools/lists/use-in-expressions/) for details on using lists in rule expressions. +::: + ## Cache eligibility In **Cache eligibility**, you have the option to select **Bypass cache** if you want matching requests to not be cached, or **Eligible for cache** if you want Cloudflare to attempt to cache them.