The speed of light is finite. Data traveling through fiber optic cables from a server in New York to a user's phone in Sydney takes time—roughly 150 milliseconds for the physical distance alone, not counting router hops and processing.
If a webpage requires 50 separate requests (HTML, CSS, JS, Images) back to that origin server, those milliseconds add up to seconds of latency. The solution is the edge.
What is Edge Caching?
A Content Delivery Network (CDN) like Cloudflare, Fastly, or AWS CloudFront is a network of servers distributed globally. When you use a CDN, you cache copies of your static assets on these edge nodes.
When that user in Sydney requests your website, they don't connect to New York. They connect to a CDN server in Sydney, which serves the images and CSS in 10 milliseconds.
Beyond Static Assets: Full Page Caching
Caching images is web development 101. The real performance leap happens when you cache the *entire HTML document* at the edge.
If you run a WordPress site or a Next.js (SSR) application, generating the HTML requires querying a database and executing code. If you cache the generated HTML at the CDN level (using Cache-Control headers or Cloudflare Page Rules), the CDN intercepts the request and serves the HTML instantly, bypassing your origin server completely.
This results in a Time to First Byte (TTFB) of under 50ms globally and allows a tiny $10/month server to handle millions of visitors.
Cache Invalidation Strategy
The hardest part of full-page caching is knowing when to clear it. If you publish a new blog post, the cached homepage needs to update.
- For WordPress: Plugins like Cloudflare's official plugin automatically purge the cache via API when you publish content.
- For Next.js: Incremental Static Regeneration (ISR) handles this elegantly, rebuilding the static page in the background and updating the CDN seamlessly.
By leveraging the edge, distance is no longer a performance bottleneck.
If your server is in New York, your users in London are suffering. Understand the mechanics of Content Delivery Networks and edge caching to achieve global sub-second load times.
- Abdullah Sajid



Leave a comment