Edge Computing on CDN: Moving Logic to the Edge

· Alex Petrov · 4 min read

Beyond Caching

Traditional CDNs cache and serve static content. Edge computing extends CDN PoPs into general-purpose computing platforms. Instead of just caching content, edge servers run your code — processing requests, transforming responses, and making decisions at the network edge, milliseconds from the user.

Performance Comparison: Edge vs Origin Processing
Metric Edge Processing Origin Processing Improvement
Latency (p50)8–15 ms120–300 ms15–20x faster
Cache Hit Ratio85–95%N/AReduces origin load
TLS Handshake1–5 ms (nearby PoP)50–150 ms10–30x faster
Bandwidth Cost$0.01–0.04/GB$0.05–0.12/GB3–5x cheaper
Availability99.99% (multi-PoP)99.9% (single DC)10x fewer outages

Why Compute at the Edge

Every request that must travel to a centralized origin adds latency. Edge compute eliminates that round-trip for logic that can run independently:

ApproachLatency (TTFB)Where Code Runs
Centralized origin100-500msOne region (US-East, EU-West)
Multi-region deploy50-200ms3-6 regions
CDN edge compute5-50ms200-300+ PoPs globally

Edge Compute Use Cases

Edge Compute Platforms

See edge functions guide for detailed comparison.

Edge Function Runtime — Internal components of edge compute platformEdge Function Runtime — Internal components of edge compute platform CDN Edge Server Architecture Load Balancer L4/L7 + Health Checks TLS Termination Certificate Management OCSP Stapling Cache Engine SSD + RAM Cache Cache-Control Parser WAF Engine Rule Processing Bot Detection Request Router URL Rewriting + Edge Logic Logging & Metrics Real-time Analytics Origin Fetch Module Connection Pooling · Retry Logic · Timeout Management
Figure 2: Edge Function Runtime — Internal components of edge compute platform

Execution Model

Edge compute functions typically follow this model:

  1. Request arrives at edge PoP
  2. Edge runtime loads your function (from cache or cold start)
  3. Function executes with access to: request object, edge cache, KV store, external APIs
  4. Function returns a response or modifies the request before forwarding to origin

Cold start times vary: V8 isolates (Cloudflare): < 1ms. Containers (Lambda): 50-500ms. WASM (Fastly): < 1ms.

Constraints

Edge compute has limitations compared to traditional servers:

External References

References & Standards: RFC 7234 · HTTP/2 specification