Skip to content

RegionalTieredCache

Source: src/Cloudflare/Cache/RegionalTieredCache.ts

The Regional Tiered Cache setting of a Cloudflare zone (/zones/{zone_id}/cache/regional_tiered_cache).

Regional Tiered Cache adds a regional layer between Cloudflare’s lower tiers and the upper-tier data center, so cache misses in a region only travel to the regional hub instead of crossing the globe. The setting is a zone singleton — it always exists on entitled zones (default off), so this resource never creates or deletes anything physical. Reconcile patches the setting when the observed value differs from the desired one; destroy restores the value the setting had before Alchemy first managed it (captured as initialValue).

Plan-gated: Regional Tiered Cache requires an Enterprise zone. On lower plans both reads and writes fail with Cloudflare error code 1135 (“this zone setting is not available for your plan type”), surfaced as the typed SettingUnavailableForPlan error.

Only one RegionalTieredCache resource per zone makes sense — two instances managing the same zone would fight over the singleton.

Enable Regional Tiered Cache on an Enterprise zone

const zone = yield* Cloudflare.Zone("Site", { name: "example.com" });
yield* Cloudflare.RegionalTieredCache("RegionalCache", {
zoneId: zone.zoneId,
});

Explicitly disable Regional Tiered Cache

yield* Cloudflare.RegionalTieredCache("RegionalCache", {
zoneId: zone.zoneId,
enabled: false,
});