Post by Master.dev (Formerly Frontend Masters)

147,140 followers

Why your website feels slow depending on where you live (and how CDNs fix it) Here's a simple idea that quietly powers most of the internet: instead of storing your data in one place, spread small pieces of infrastructure all over the world. The first person to request a page pays the "cost" of traveling all the way to the original server. But everyone after them doesn't have to make that same trip. Say someone on the east coast of Australia loads a page that's hosted in the US. That request travels all the way to a data center in the US, gets cached regionally, and gets served back. Now if someone on the west coast of Australia requests that same page, they don't need to go all the way back to the US. They just hit the nearby regional cache. This isn't theoretical. When we first measured this in the real world, the pattern was exactly what you'd expect: the closer you were to the origin server (Chicago, in this case), the faster things were. The further away you got, the slower it got. Distance and latency, tracking together, measurably. The logic behind a CDN like CloudFront comes down to one simple check every time a request comes in: is there a cached version nearby? If yes, serve it immediately. If no, go fetch it from the origin (like US East 1) and cache it for the next person. It's a good reminder that a lot of "the internet feeling fast" isn't magic, it's just good infrastructure design putting data closer to the people asking for it.

Post content

Video Content