Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

22 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Content Delivery Network (CDN) Implementation

Go Redis Docker

A distributed CDN solution designed to optimize web content delivery through geographic edge servers and caching.

Project Overview

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

Key Components

πŸ–₯ Origin Server (Port 9090)

  • 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

🌐 Edge Servers

Location Port Features
US 8080 - Redis caching
- Latency monitoring
- Auto-redirect from /
EU 8090 - Cache synchronization
- TTL management (10min)
- Request metrics

Getting Started

Prerequisites

  • Install Go (v1.21+)
  • Install Redis (v7.0+)
  • Install Docker (v24.0+)

Installation

  1. Clone the repository:

    git clone https://github.com/JasminPradhan/ContentDeliveryNetwork.git
    cd ContentDeliveryNetwork
  2. Start the origin server:

    go run origin/main.go
  3. 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
  4. Access the CDN:

    • US Edge Server: http://localhost:8080
    • EU Edge Server: http://localhost:8090

System Architecture

graph TD
    User -->|Request| Edge
    Edge -->|Cache Hit| User
    Edge -->|Cache Miss| Origin
    Origin -->|Content + Headers| Edge
    Edge -->|Cache & Deliver| User

Loading

Demonstration

Cache-Aware Delivery System

  • Automatic Source Selection:
    GET /main.html HTTP/1.1
    X-Cache-Status: hit (US Edge) | miss (Origin)
    
    

Screenshot (148) Screenshot (147) Screenshot (146) Screenshot (145) Screenshot (144) Screenshot (143) Screenshot (142) Screenshot (141) Screenshot (140) Screenshot (139) Screenshot (138) Screenshot (137) Screenshot (136) Screenshot (135)

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages