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 for hostnames in a list: A Guide for Website Owners

Use Cloudflare Cache Rules to make selected hostnames eligible for caching, with a hostname list that keeps the rule's scope clear and manageable.

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 cache requests for several selected hostnames in Cloudflare, create a hostname list, make a Cache Rule with a custom filter that matches the list, and set Cache eligibility to Eligible for cache. The list controls which hostnames the rule matches; this is Cloudflare-specific configuration.

What you are configuring#

Cloudflare describes caching as storing copies of frequently accessed website content across its distributed network. Cache Rules let website owners choose which requests are eligible for caching. In this example, the rule matches the hostnames in a list, allowing one rule to cover that defined group.

The documented result is cache eligibility. The instructions do not provide a cache-hit rate, response-time change, or other performance measurement.

Create the hostname list#

  1. Create a hostname list in your Cloudflare account.
  2. Add the hostnames that the rule should match.
  3. Keep track of the list name. Cloudflare's example uses my_hostnames.

The list defines the rule's hostname scope. Hostnames that are not included in the list are outside this match.

Create the Cache Rule#

  1. Create a Cache Rule.
  2. Use a custom filter.
  3. Match hostnames with either of Cloudflare's documented forms:
  • Hostname is in list "my_hostnames"
  • (http.host in $my_hostnames)
  1. Set Cache eligibility to Eligible for cache.

The resulting configuration can be summarized as follows:

Data table from this page
Rule partValue
ScopeThe hostnames in the selected hostname list
Custom filterHostname is in list "my_hostnames" or (http.host in $my_hostnames)
Cache settingCache eligibility: Eligible for cache

Check the rule's scope#

Before applying the rule, confirm that the hostname list contains only the hostnames intended for this caching policy and that the filter refers to the correct list name. A list named differently from my_hostnames must be referenced with its actual name.

These instructions describe Cloudflare's Cache Rules terminology and behavior. The filter syntax and cache setting should not be assumed to work the same way with another hosting or CDN provider.

For the vendor's complete examples and background, see Cloudflare's hostname-list Cache Rule example and Cloudflare cache documentation.

Sources

  1. Cloudflare: Cache everything for hostnames in a list Checked 2026-11-13
  2. Cloudflare cache documentation Checked 2026-11-13