← Back to Guide
Chapter 02
2. Content Delivery Network (CDN)
Speeding up delivery by bringing content closer to the user.
CDN: Speed at the Edge
Once the browser has the IP address, it sends a request. In a high-availability setup, this request often hits a Content Delivery Network (CDN) first, rather than your main server.
Why Use a CDN?
A CDN is a network of servers distributed globally. Its primary roles are:
- Latency Reduction: By serving content from a server physically closer to the user (an "Edge Server"), we drastically reduce load times.
- Load Offloading: Static assets (images, CSS, JS) are cached at the edge, meaning your main servers don't have to work as hard.
- DDoS Protection: CDNs can absorb massive amounts of traffic, protecting your origin infrastructure from attacks.
The Flow
- User Request: The user requests
image.jpg. - Edge Check: The nearest CDN server checks if it has a cached copy.
- Cache Hit: If yes, it returns the file immediately.
- Cache Miss: If no, it fetches it from your Origin Server, caches it for next time, and then returns it.