A distributed CDN solution designed to optimize web content delivery through geographic edge servers and caching.
This CDN implementation enhances website performance by:
- Reducing latency through geographic distribution
- Improving load times by 50-70%
- Providing redundancy and DDoS protection
- Utilizing Redis caching with automatic content expiration
- Implementing load balancing across edge servers
- Serves core HTML content via Go + Gorilla Mux
- Pages:
/main.html- Home page/arch.html- System architecture/desc.html- CDN benefits documentation
- Acts as content source for edge servers
| Location | Port | Features |
|---|---|---|
| US | 8080 | - Redis caching - Latency monitoring - Auto-redirect from / |
| EU | 8090 | - Cache synchronization - TTL management (10min) - Request metrics |
-
Clone the repository:
git clone https://github.com/JasminPradhan/ContentDeliveryNetwork.git cd ContentDeliveryNetwork -
Start the origin server:
go run origin/main.go
-
Start the edge servers:
cd edge-eu docker build -t cdn-edge-eu . docker run -p 8080:8090 cdn-edge-eu
cd edge-us docker build -t cdn-edge-us . docker run -p 8060:8080 cdn-edge-us
-
Access the CDN:
- US Edge Server:
http://localhost:8080 - EU Edge Server:
http://localhost:8090
- US Edge Server:
graph TD
User -->|Request| Edge
Edge -->|Cache Hit| User
Edge -->|Cache Miss| Origin
Origin -->|Content + Headers| Edge
Edge -->|Cache & Deliver| User
- Automatic Source Selection:
GET /main.html HTTP/1.1 X-Cache-Status: hit (US Edge) | miss (Origin)













