Content Delivery Network (CDN)
Visualize how CDNs reduce latency by serving content from edge locations closer to users, with real-time cache behavior and performance metrics.
Step 01 · Concept Snapshot
CDN = serve static files from closer locations
Use this page to see how edge caching changes latency, origin load, freshness, cost, and failure behavior.
Without CDN
Every static request hits origin. Distant users wait for the full round trip.
With CDN
Static files served from nearby edge. Origin only involved on cache miss.
Choose a scenario
Static images dominate. High CDN benefit, low freshness risk.
Step 02 · CDN Behavior
Simulate CDN request routing
Change mode, location, and cache state to see consequences.
CDN Mode
User Location
Asset Type
Cache State
TTL Setting
Live System View
Hover any node to understand its role.
Step 03 · System Metrics
Avg Latency
14ms
Origin Requests
4%
CDN Hit Rate
96%
Freshness Risk
55%
Step 04 · What Changed
Step 05 · Freshness Tradeoff
Update the origin and watch the CDN serve old or fresh content
CDN performance depends on caching, but correctness depends on freshness rules.
Origin Server
logo-v1.png
Current version
CDN Edge
logo-v1.png
Fresh
TTL Setting
TTL 1h — suitable for most static assets. Deploy with cache invalidation.
Step 06 · Failure Mode
What happens when the CDN goes down?
CDN improves performance, but the system still needs fallback behavior for outages.
CDN Status
Fallback
Latency
14ms
Origin Load
4%
Availability
99.9%
Step 07 · Cost Tradeoff
Should this asset be on the CDN?
Select an asset type to see the cost, benefit, and freshness tradeoffs.
Product image
Good CDN fitFrequently requested, rarely changes.
Step 08 · Validate Understanding
Reduce global image latency
Users in India load images from a US origin. Use CDN edge caching.
Handle first request
Edge server does not have video.mp4. Fetch from origin, cache, return.
Fix stale CSS after deploy
Users still receive old app.css. Invalidate the CDN object.
Lower origin load
90% of requests hit the same static asset. Increase CDN hit rate.
Plan outage fallback
CDN provider is unavailable. Fallback to origin and monitor load.
Step 09 · Solution Panel
Walkthrough, comparison, and interview answer.
Why this exists
A CDN moves content closer to users by serving it from geographically distributed edge caches. The main value is not just speed. It is removing repeated load from the origin while reducing latency for distant users.
Distance creates latency
Even a well-tuned origin feels slow when it is far away. Edge caching shortens the physical path for repeated content.
Origins should serve the uncommon path
The origin should mainly handle cold misses, personalization, or dynamic work. Repeated static delivery belongs at the edge.
Cacheability determines value
A CDN is strongest for static assets and cacheable responses. Highly personalized traffic limits what the edge can absorb.
Key takeaways
- CDNs reduce latency and protect the origin simultaneously.
- They work best for static assets and predictable cache lifetimes.
- Edge misses still need a healthy origin path.
- Cache headers are part of the system design, not just frontend implementation.