CDN
Content Delivery Network
A geographically distributed network of servers and their data centers that help in web content distribution to users with minimal delay.
How does CDN work
CDN works by bringing content closer to the geographic location of the end users.
- Located data centers situated around the world
- Within each Points of Presence (PoPs) are thousands of caching servers
- Improve connectivity and accelerate the speed at which content is delivered to the end user.
![](/note/computer-network/application-layer/cdn/CDN_hu72427bd34d3a2522517a4e3e3a6c312a_208523_f6be9962ab902337089254e013fe4ec7.png)
Work process
- The user sends a request to the business’ web server to retrieve all the page’s components
- The assets are retrieved from the origin server and once delivered are stored in the PoP edge caching server close to the end user.
- When the same user requests the same assets the next time, the requests don’t go to the origin server. Instead the requests go to the cached files from the PoP server to see if the stored assets are still available and deliver them to the user.
- If they are not available or the caching server has not cached the assets yet, the request is sent to the origin server again.
- Once your static assets are cached on all the CDN servers for a particular location, all subsequent website visitor requests for static assets will be delivered from these edge servers instead of the origin server.
Push CDN and Pull CDN
Push CDN | Pull CDN | |
---|---|---|
feature | Receive it whenever changes occur | grad new content when the first user requests the content |
Timeliness | Can configure when content expires and when it is updated | A TTL determines how long content is cached |
Applicable scene | Frequently updated, less users requests | High Traffic, Small download |
Benefits
- Faster delivery
- Optimize bandwidth and latency
- Improve website security
- Offer Distributed Denial of Service or DDoS protection by distributing the malicious requests across the network
- Help control access to different regions
- Delegate authentication tasks to the edge
- Help in collecting logs and analyzing user-generated data
Disadvantages
- Costs depends on traffic
- Content may be stale if it is updated before TTL expires
- CDNs require changing URLs for static content to point to the CDN
The content cited from CDNetworks.