Lesson 1 of 9 · 20m
The Edge Network Mental Model
What changes when a request terminates 30 milliseconds from the user instead of in your one blessed region.
Most engineers meet the edge backwards: they put Cloudflare in front of a site because someone said it makes things faster, then spend six months discovering which parts of their architecture quietly depended on every request reaching the same box. The edge is not magic CDN dust. It is a different execution model, and it rewards people who understand where a request actually goes.
Your origin stops being the front door
When a domain is proxied through Cloudflare, DNS returns Cloudflare anycast addresses, not yours. The user's TLS connection terminates in a nearby point of presence. Only then does Cloudflare decide whether to answer from cache, run a Worker, block the request, or fetch your origin.
user in Lisbon
-> nearest Cloudflare PoP (TLS terminates here)
-> cache hit? answer immediately
-> Worker? execute in the isolate at that PoP
-> otherwise fetch origin over Cloudflare's backboneThis is why edge latency wins are real: the TCP and TLS handshakes — often the slowest part of a cold request — happen close to the user. The origin leg reuses warm connections Cloudflare already maintains.
Anycast is routing, not replication
The same IP address is announced from hundreds of locations. BGP sends the user to a nearby PoP, but "nearby" is network topology, not geography. More importantly: your data is not automatically replicated. A cached object, a KV value, a Durable Object, and an origin database each have completely different consistency and locality properties. Treating "the edge" as one coherent computer is the first architectural mistake.
Failure domains shift outward
In a single-region app, when the region is down the app is down. At the edge, individual PoPs can be unreachable while the service as a whole keeps working — users simply route elsewhere. That is powerful, but it also means partial degradation becomes normal: cache hit ratios differ per PoP, a bad deployment can appear in some cities before others, and your origin can be healthy while edge behavior is wrong.
What stays the same
The edge does not repeal application fundamentals. Your origin still owns the durable database, the domain model, and the final authorization decision. Headers can be forged by clients before Cloudflare sees them, but Cloudflare-added headers can be trusted only when the origin is locked down to Cloudflare traffic. Observability also becomes multi-layered: browser timing, edge ray IDs, Worker logs, cache status, and origin logs all describe the same request from different positions.
That is the mental model to carry forward: Cloudflare is a programmable perimeter and distribution fabric. It can absorb load, shape traffic, and execute small pieces of logic close to users, but it does not make architecture disappear. It moves some of it outward.
Field notes
www.example.combeing "orange-clouded" means proxied; gray-cloud means DNS-only and Cloudflare cannot inspect or accelerate the traffic.- Edge termination means the origin sees Cloudflare IPs, not client IPs. Read
CF-Connecting-IPor, better, configure authenticated origin pulls so random internet traffic cannot bypass the edge. - Never put secrets or authorization decisions only in edge response manipulation. Anything client-controlled can still be manipulated before it reaches you.
- Measure with real user monitoring, not one curl from your office. Edge performance is inherently a distribution across locations.
Was this lesson helpful?