Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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):

<Example>

- **When incoming requests match**: Custom filter expression
- Using the Expression Builder:<br/>
`Hostname is in list "my_hostnames"`
- Using the Expression Editor:<br/>
`(http.host in $my_hostnames)`

- **Then**:
- **Cache eligibility**: Eligible for cache

</Example>

:::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.
:::
7 changes: 7 additions & 0 deletions src/content/docs/cache/how-to/cache-rules/settings.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Loading