Cache Hit vs Cache Miss at the Edge
What you'll learn: How CDN edge servers decide whether to serve content directly from their cache or fetch it from the origin server.
When a user requests content through a CDN, the edge server must make a quick decision: do I already have this content cached, or do I need to retrieve it from the origin?
Cache Hit: Fast Lane
A cache hit occurs when the requested content is already stored at the edge server. The CDN immediately serves the content to the user without contacting the origin server. This is the ideal scenario—it's fast, reduces origin load, and minimizes bandwidth costs.
Example: A user in Tokyo requests example.com/logo.png. The Tokyo edge server checks its cache, finds the logo already stored, and instantly delivers it. Total time: milliseconds.
Cache Miss: Detour Required
A cache miss happens when the content isn't cached at that edge location. The edge server must fetch the content from the origin server, which takes longer because data travels the full distance. After retrieving it, the edge server typically stores a copy for future requests.
Example: The same user requests a brand-new blog post. The Tokyo edge server doesn't have it cached yet, so it fetches it from the origin server in Virginia, serves it to the user, then caches it locally. The first user experiences slower delivery, but subsequent users in Tokyo get a cache hit.
The Performance Impact
Cache hits are what make CDNs valuable—they can be 10-100x faster than cache misses. A well-optimized CDN aims for a high cache hit ratio (percentage of requests served from cache). Even a 90% hit ratio means 10% of requests still experience the slower miss pathway.
Key Takeaway: Cache hits deliver content instantly from the edge, while cache misses require fetching from the origin—the first request pays the latency cost, but future requests benefit from cached content.