Skip to main content
sitewarm
CDN concepts

What is tiered caching on a CDN?

Tiered caching puts upper-tier caches between edge PoPs and the origin, so a miss at the edge asks an upper tier before the origin.

Tiered caching is a CDN setup where edge PoPs do not go straight to the origin on a miss. They ask an upper-tier cache first, and only the upper tier fetches from the origin. Fewer locations call the origin, and a page fetched once by the upper tier can then serve many edge PoPs.

visitor -> edge PoP (miss) -> upper tier (hit)   -> edge stores copy
visitor -> edge PoP (miss) -> upper tier (miss)  -> origin

Vendors name it differently: Cloudflare Tiered Cache, Fastly shielding, Amazon CloudFront Origin Shield and Akamai tiered distribution. The idea is the same. Cloudflare describes lower tiers, generally the ones closest to a visitor, asking an upper tier, with only the upper tier allowed to contact the origin.

  • It reduces origin load after a purge, but does not warm the edge. Each edge PoP still misses once and pays the round trip to the upper tier.
  • It shows up in `Cache-Status` as several entries, or in x-cache as several values, one per tier.
  • Cache warming from several regions fills the upper tier and the edges your visitors use.

Tiers differ by CDN: see Cloudflare Tiered Cache, Fastly shielding, CloudFront Origin Shield and Bunny.net Origin Shield. The Top 10 CDNs comparison scores origin protection for ten CDNs.

References

  1. Cloudflare: Tiered Cachehttps://developers.cloudflare.com/cache/how-to/tiered-cache/
  2. Fastly: Shieldinghttps://www.fastly.com/documentation/guides/concepts/shielding/
  3. Amazon CloudFront: Origin Shieldhttps://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/origin-shield.html

Warm your cache after every deploy

sitewarm requests the pages in your sitemap after a deploy and reports the cache state the CDN returns for each one, with the vantage point it was measured from.