Skip to main content

CDN and Caching

Cloudflare's CDN (Content Delivery Network) is one of the largest in the world, spanning 330+ cities globally. It stores copies of your website's static content at edge locations closest to your visitors, dramatically reducing latency and offloading traffic from your origin server.

Why This Matters

A CDN can reduce your page load time by 50–80% for static assets. Cloudflare's CDN is free and active by default on every proxied domain.

How Cloudflare CDN Works

What You Will Learn

LessonWhat It Covers
CDN and Cache FundamentalsHow the CDN works, what gets cached, Cache-Control headers, and cache purging
Speed BrainPrefetch acceleration for faster page navigation
Cache RulesModern, granular caching policies — per path, cookie, header, or country (10 free)
Page Rules (Legacy)The older per-URL rule system, common patterns, and full migration guide
Tiered CacheHierarchical caching that shields your origin and increases cache HIT ratios globally
Cache ReservePersistent R2-backed cache layer that eliminates evictions for long-tail content (paid)
Cache ConfigurationZone-wide settings: Caching Level, Browser Cache TTL, Purge, Dev Mode, Always Online, and more

Prerequisites

  • Domain added to Cloudflare with proxied DNS records (Module 1)
  • Basic understanding of HTTP headers