Actual Response Headers
Latency Comparison: CDN vs Direct Origin
What This Proves
Cache Hit/Miss Mechanics
First request: MISS — CDN fetches from origin, stores copy, serves to user (~200-300ms). Subsequent requests: HIT — served directly from edge node (~10-20ms). Cache eviction occurs based on TTL, LRU policy, or manual purge.
Cache-Control Directives
public: CDN may cache. private: browser only. no-store: never cache. immutable: never revalidate (for versioned assets). stale-while-revalidate: serve stale while fetching fresh.
CDN Edge Network Topology
Global anycast network routes users to nearest PoP (Point of Presence). Origin shield reduces origin load. Tiered caching: L1 (edge) → L2 (shield) → Origin. This site uses Fastly's 200+ edge locations.
Cache Invalidation Strategies
Hard purges (immediate removal), soft purges (mark stale), surrogate keys (tag-based purging), or time-based TTL. "Cache busting" via filename hashing: app.a3f2b1.js enables infinite caching.
Content Hashing for Cache Busting
Versioned filenames based on content hash ensure changed files get new URLs, while unchanged files remain cached forever. Combined with immutable directive, eliminates revalidation overhead entirely.
Real-World CDN Awareness
GitHub Pages serves via Fastly's CDN. Response headers reveal cache status (X-Cache: HIT/MISS), serving POP (cache-fra19123-FRA), and compression. Understanding these headers is essential for debugging performance.