Understanding CDN: Definition, Working Principles, and Key Terminology
This article explains what a Content Delivery Network (CDN) is, how it optimizes web traffic through caching and intelligent DNS routing, details the traditional versus CDN-enabled access processes, and clarifies related terms such as CNAME records, DNS, origin host, and protocol origin.
1. What is CDN
CDN (Content Delivery Network) adds a caching layer to the Internet, publishing website content to edge nodes closest to users, thereby reducing latency, alleviating source server load, and improving response speed. In simple terms, CDN caches resources from the origin server on globally distributed nodes and serves users from the nearest cache.
CDN Node
How CDN Optimizes the Network
Solves the "first mile" problem on the server side.
Mitigates bottlenecks caused by inter‑operator connectivity.
Reduces provincial outbound bandwidth pressure.
Alleviates backbone network load.
Optimizes distribution of popular online content.
2. CDN Working Principle
Traditional Access Process
Traditional Access Process
As shown, the process for accessing a site without CDN caching is:
1. User enters the domain name; the OS queries Local DNS for the IP. 2. Local DNS queries ROOT DNS for the authoritative server (assuming cache miss). 3. ROOT DNS returns the authoritative DNS record to Local DNS. 4. Local DNS queries the authoritative DNS for the IP address. 5. Authoritative DNS responds with the IP record. 6. Local DNS returns the IP to the client. 7. Client accesses the origin server. 8. Origin server responds with the content.
CDN Access Process
CDN Access Process
After using CDN caching, the access process becomes:
1. User enters the domain name; the OS queries Local DNS for the IP. 2. Local DNS queries ROOT DNS for the authoritative server (cache miss assumed). 3. ROOT DNS returns the authoritative DNS record to Local DNS. 4. Local DNS obtains the CNAME record and queries the authoritative DNS for the IP. 5. Authoritative DNS returns the CNAME (usually pointing to a CDN node). 6. Local DNS queries the intelligent scheduling DNS for the optimal CDN node IP. 7. Intelligent scheduling DNS selects the best node based on algorithms and policies and returns its IP. 8. Local DNS returns this IP to the client. 9. Client accesses the CDN node. 10. CDN node serves cached content or fetches from the origin if not cached.
To make CDN acceleration transparent to end users, DNS redirection is used so that the first step (domain resolution) directs requests to the nearest cache server.
Components of the CDN Network
Each CDN node acts like a web server placed near users; DNS hijacking transparently routes user requests to the nearest node, which responds faster because it is closer.
Intelligent Scheduling DNS (e.g., F5's 3DNS) : Core system that, based on predefined policies, selects the nearest healthy CDN node for each request and maintains communication with all nodes.
Cache Service Functions : Load balancers (e.g., LVS, F5 BIG‑IP) Content cache servers (e.g., Squid) Shared storage
3. Glossary
CNAME Record
CNAME (Canonical Name) maps one domain name to another. When a DNS query encounters a CNAME, it follows the alias to the target name until an A or PTR record is found. Example: to let documents.example.com serve the same resources as docs.example.com , add a CNAME record pointing documents.example.com to docs.example.com .
CNAME Domain
When you add an acceleration domain in a CDN console, the provider gives you a CNAME domain. You must create a CNAME record at your DNS provider that points your own acceleration domain to this CNAME, causing all requests to be routed to CDN nodes.
DNS
Domain Name System translates human‑readable domain names to IP addresses. For example, www.baidu.com resolves to 220.181.112.143 . Common DNS providers include Alibaba Cloud DNS, DNSPod, Route53, Cloudflare, etc.
Origin Host
The origin host determines which specific site on the origin server the CDN should request.
Example 1: Origin domain is www.a.com , origin host is www.b.com . The request is sent to the IP of www.a.com but the host header is www.b.com . Example 2: Origin IP is 1.1.1.1 , origin host is www.b.com . The request goes to 1.1.1.1 with host header www.b.com .
Protocol Origin
When the CDN fetches content from the origin, it uses the same protocol (HTTP or HTTPS) that the client used to request the resource.
看完本文有收获?点赞、分享是最大的支持!
Laravel Tech Community
Specializing in Laravel development, we continuously publish fresh content and grow alongside the elegant, stable Laravel framework.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.