โ† Cloudflare & Edge Computing learning path
Cloudflare & Edge Computing ยท Module 3 of 10

CDN and caching

Cloudflare caches files at the edge so the origin does less work.

๐Ÿ“– Key ideas

  1. Static files (images, CSS, JS) are cached by default.
  2. HTML is not cached by default unless you add a cache rule.
  3. Cache-Control headers from your origin guide caching.
  4. Purge cache after a deploy, by URL or everything.
  5. cf-cache-status header shows HIT, MISS, EXPIRED or BYPASS.
๐Ÿ’ก Real-life example: Like a local shop stocking popular items so customers do not wait for delivery from the factory.
Cache hitServed from the edge cache
PurgeRemove cached copies
Cache-ControlHeader with caching instructions
cf-cache-statusHeader showing cache result