Skip to content

TieredCaching

Source: src/Cloudflare/Argo/TieredCaching.ts

Tiered Caching for a Cloudflare zone (/zones/{zone_id}/argo/tiered_caching).

Tiered Caching routes cache misses through upper-tier Cloudflare data centers instead of every edge location contacting the origin directly, reducing origin load and improving cache hit ratios. It is available on all plans, free included.

The setting is a singleton — it always exists on every zone with a Cloudflare default, 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).

This is the generic Tiered Cache toggle (the dashboard “Tiered Cache” switch). Smart Tiered Cache (the smart-topology variant managed under /cache/tiered_cache_smart_topology_enable) requires Tiered Caching to be enabled — deploy this resource first when combining the two.

Enable Tiered Caching on a zone

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

Explicitly disable Tiered Caching

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