Reverse Proxy, CDN, and Edge Computing
Reverse Proxy
Sits in front of your servers. Clients talk to the proxy, proxy talks to servers.
Client ──► Reverse Proxy (nginx/Envoy) ──► App Server 1
──► App Server 2
Handles: SSL termination, compression, caching, load balancing,
rate limiting, request routing, security (WAF)
CDN (Content Delivery Network)
Geographically distributed cache. Serves static content from the nearest edge server.
Push vs Pull CDN
| Type | How | Best For |
|---|---|---|
| Pull | CDN fetches from origin on first request, caches | Dynamic content, most sites |
| Push | You upload content to CDN proactively | Large static files, known content |
Edge Computing
Run compute at CDN edge nodes (Cloudflare Workers, Lambda@Edge). Process requests close to users without hitting origin.
Key Takeaways
- Reverse proxy: single entry point, handles cross-cutting concerns
- CDN: cache static content at edge, reduce latency for global users
- Edge computing: run logic at CDN nodes for ultra-low latency
- Use CDN for: images, CSS/JS, video, API responses with short TTL