Skip to content

SYSTEM Cited by 1 source

Cloudflare Smart Tiered Cache

Smart Tiered Cache is Cloudflare's most popular tiered cache topology — available to all plans for free. For each origin behind a customer's site, Smart Tiered Cache selects a single optimal upper-tier data center to route cache misses through, based on real-time latency probing refreshed every 15 minutes.

Core Mechanism

  1. Latency probes run continuously from every Cloudflare data center to every known origin IP.
  2. The data center with the lowest measured latency becomes the upper tier (single funnel point).
  3. All edge POPs route their cache misses through this upper tier before reaching origin.
  4. By concentrating misses at one point, the upper tier builds a full working set → higher hit ratios, fewer origin connections.

The Anycast Problem

When origins sit behind anycast or regional unicast IPs (common on AWS, GCP, Azure, Oracle Cloud), the probing system breaks:

  • The origin IP appears equally close to many Cloudflare POPs simultaneously.
  • The IP represents the cloud provider's front-end, not a single physical origin.
  • Smart Tiered Cache cannot confidently pick one best upper tier.
  • Fallback: multiple upper tiers (safe but suboptimal — dilutes cache efficiency).
  • Worst case: hairpin routing — e.g., Singapore origin routed via Chicago upper tier, adding hundreds of ms.

Anycast Detection (Speed of Light)

Smart Tiered Cache detects anycast origins using a physics constraint:

If combined latencies from two checkpoint data centers to an origin are faster than what light in fiber could physically travel between those two checkpoints, the origin must be answering from multiple locations.

This is a reliable signal because no single-location origin can violate the speed-of-light bound.

Public Cloud Regions (2026)

The fix for anycast cloud origins:

  1. Customer provides a region hint (e.g., aws:us-east-1, gcp:europe-west1).
  2. Cloudflare fetches cloud provider IP-range files every few hours (maps regions → IP prefixes).
  3. Each subnet contributes a weighted vote based on its current upper-tier assignment from probe data.
  4. The upper tier with the strongest signal becomes the region's primary.
  5. Primary and fallback always come from different PoPs (patterns/primary-fallback-pop-separation).
  6. Regions without enough probe data fall back to the geographically closest Tier-1 PoP.

Evolution

Date Extension What it teaches the system
2021 Base launch Fixed-IP origins with clear latency winner
Nov 2024 R2-aware Auto-select closest tier to R2 bucket location
Jan 2025 Load Balancing pools Single tier for entire LB pool (shared cache)
Jul 2026 Public Cloud Regions Anycast/regional-unicast origins via region hints

Configuration

  • Dashboard: Caching > Tiered Cache > Origin Configuration — set per-IP region hints.
  • Also available via API and Terraform.
  • Hints only settable for origins whose IPs are detected as anycast.

Seen in

Last updated · 575 distilled / 1,757 read