Skip to main content
ThinkNote

Understanding CDN and Edge Computing

Your NameYour Name
August 29, 2025
3 min read
Table of Contents

What Are CDN and Edge Computing?

In the world of modern web development, speed and user experience are paramount. CDN (Content Delivery Network) and Edge Computing are two critical technologies that optimize performance by bringing content and application logic closer to the end-user.


1. Content Delivery Network (CDN)

A CDN (Content Delivery Network) is a geographically distributed network of servers. Its primary role is to cache and deliver static content (like images, CSS, and JavaScript) from the server closest to the user, reducing latency and speeding up page load times.

Traditional Flow (Without CDN)

When a user in the US accesses a website hosted in Vietnam, the request has to travel a long physical distance.

User (US) <--> Internet <--> Origin Server (Vietnam)

Diagram 1: Access flow without a CDN

=> Limitation: High latency, slow page load speed, and a poor user experience.

Flow with a CDN

With a CDN, content is cached at various "Points of Presence" (PoPs) around the globe.

First visit:
1. User (US) --> Nearest CDN PoP
2. CDN PoP (cache miss) --> Origin Server (Vietnam)
3. Origin Server (Vietnam) --> CDN PoP (content is now cached)
4. CDN PoP --> User (US)

Subsequent visits:
Another User (US) --> CDN PoP (returns content from cache)

Diagram 2: Access flow with a CDN

=> Benefits: Reduces the load on the origin server, accelerates content delivery, and significantly improves the user experience.


2. Edge Computing

Edge Computing is an evolution of the CDN model. Instead of just caching static files, it allows you to run application code or business logic on edge servers, right next to the user.

This means that simple processing tasks that don't require complex database interactions can be handled at the edge without sending a request all the way back to the origin server.

Limitations of a Traditional CDN

A CDN can only cache content. If a request requires processing (e.g., authentication, calculations, simple API calls), it must still be forwarded to the origin server.

User (US) --> CDN PoP (cannot process) --> Origin Server (Vietnam)

Diagram 3: CDN with a request requiring logic processing

The Power of Edge Computing

With Edge Computing, business logic can be deployed as functions (Edge Functions) and executed directly at the edge.

User (US) --> Edge Server (Executes logic and returns the result)

Diagram 4: Processing flow with Edge Computing

=> Benefits: Minimizes latency for dynamic tasks, dramatically reduces traffic to the origin server, and enables the creation of ultra-responsive applications.


3. Detailed Comparison

Criteria Traditional CDN Edge Computing
Primary Role Cache and deliver static files. Execute code and business logic at the edge.
Processed Content Images, videos, CSS, JavaScript... Business logic, request/response handling, A/B testing...
Origin Interaction Frequent on the first visit (cache miss). Less frequent; can handle requests entirely at the edge.
Content Type Static. Dynamic.
Complexity Easy to set up and configure. More complex, requires programming knowledge.
Examples Cloudflare CDN, Amazon CloudFront. Cloudflare Workers, Vercel Edge Functions, AWS Lambda@Edge.

Conclusion

A CDN is an essential tool for accelerating the delivery of static content, while Edge Computing ushers in a new era of high-performance web applications by enabling logic processing at the edge. The choice between them depends on your application's specific needs and the level of dynamic interaction you want to provide to your users.