A cache miss is a request that a cache cannot answer from its own storage, because it holds no copy of the requested object or holds only a copy it may not serve, so the request must be forwarded to an upstream tier or to the origin server. In content delivery, cache misses determine how much traffic reaches the origin, how long users wait for the first byte and how much a CDN deployment costs to operate.
Every miss is the opposite of a cache hit, and the proportion between the two is expressed as the cache hit ratio. Understanding why misses happen, which kinds can be avoided and which are inherent, is the core of tuning any CDN, edge network or reverse proxy.
What happens during a cache miss
When an edge server receives a request, it computes a cache key, usually from the host, path and selected query parameters and headers, and looks that key up in memory and on disk. If no entry exists, or the entry is expired and cannot be revalidated in time, the edge opens or reuses a connection to its parent tier or the origin and requests the object.
The upstream response is streamed to the client and, if the Cache-Control headers permit storage, written into the cache for later requests. The client of a miss therefore pays the full round trip to the origin, which may add tens to hundreds of milliseconds depending on distance and origin processing time.
CDNs report the outcome of each request in a cache status header or log field. The following table shows typical status values and what they mean for the request.
| Status | Meaning | Origin contacted |
|---|---|---|
| HIT | Valid copy served from cache | No |
| MISS | No usable copy, fetched upstream | Yes |
| EXPIRED | Stale copy replaced by a fresh fetch | Yes |
| REVALIDATED | Stale copy confirmed by a 304 response | Yes, headers only |
| STALE | Stale copy served while upstream is slow or failing | In the background or not at all |
| BYPASS | Caching skipped by rule or header | Yes |
Types of cache misses
Cache misses fall into several distinct categories, and each calls for a different remedy. Some are unavoidable, while others signal configuration errors that waste origin capacity.
| Miss type | Cause | Typical remedy |
|---|---|---|
| Cold miss | First request for an object at that location | Prewarming or tiered caching |
| Expiration miss | Time to live has elapsed | Longer TTL or revalidation with ETag |
| Capacity miss | Object evicted to free space | Larger cache or better eviction policy |
| Fragmentation miss | Cache key varies more than content does | Normalize query strings and Vary headers |
| Purge miss | Object deliberately removed | Targeted purges using cache tags |
| Uncacheable request | Private, personalized or POST content | Split static and dynamic parts |
Fragmentation misses are the most common avoidable kind. A tracking parameter such as a campaign identifier, a cookie included in the key or a Vary: User-Agent header can turn one cacheable object into thousands of separate cache entries, each of which misses on its first request.
Why cache misses matter for performance and cost
Each miss has three effects: higher latency for the user, additional load on the origin and extra egress traffic between the origin and the CDN. Because origin servers are usually sized for the miss traffic rather than the total traffic, a drop in hit ratio from 95 percent to 90 percent doubles the origin request volume.
The table below compares typical latency contributions of a hit and a miss for a static asset. Exact values vary widely with geography, protocol and origin design, so the figures are indicative ranges rather than guarantees.
| Path | Typical time to first byte | Main contributor |
|---|---|---|
| Edge hit | 5 to 40 ms | Distance from user to point of presence |
| Miss served by origin shield | 30 to 120 ms | Edge to shield round trip |
| Miss served by origin | 80 to 500 ms or more | Origin distance and processing |
Misses also concentrate risk. When a popular object expires simultaneously at many edges, a thundering herd of requests can hit the origin at once, which is why request collapsing and stale serving are standard countermeasures.
Techniques that reduce cache misses
Reducing misses combines correct HTTP caching headers, careful cache key design and CDN architecture features. The most effective measures are listed below.
- Set explicit Cache-Control directives such as
max-ageands-maxageinstead of relying on heuristics. - Use versioned file names for assets so they can be cached for a year and never revalidated.
- Normalize the cache key by removing irrelevant query parameters and sorting the rest.
- Enable tiered caching or an origin shield so that edge misses are absorbed by a regional parent.
- Turn on request collapsing so concurrent misses for one object produce a single origin fetch.
- Apply stale-while-revalidate and stale-if-error to serve slightly old content while refreshing it.
Purging also needs care. Purging everything after a small change produces a wave of cold misses across every point of presence, whereas tag-based or URL-based purges remove only the objects that changed.
Diagnosing and measuring misses
Diagnosis starts with the cache status header and CDN logs, broken down by URL pattern, content type and point of presence. A low hit ratio on a few URL patterns usually indicates key fragmentation or missing headers, while a low ratio spread evenly across a region often points to insufficient cache capacity or low traffic per location.
| Observed pattern | Probable explanation | First check |
|---|---|---|
| Every request is a miss | Response marked private or no-store | Origin Cache-Control and Set-Cookie headers |
| Misses after every deployment | Broad purges or unversioned assets | Purge scope and file naming |
| Many misses on one URL | Varying query strings or headers | Cache key configuration |
| Misses only in small regions | Low request volume per location | Tiered caching settings |
Teams should distinguish the request hit ratio from the byte hit ratio. A site may serve most requests from cache while large video or download files still miss frequently, so origin bandwidth stays high even though the request-based figure looks healthy.
In plain words
Imagine a small shop that keeps popular items on its shelves and orders everything else from a central warehouse. When a customer asks for something already on the shelf, the sale is instant. When the item is missing, the shop must order it and the customer waits longer. That missing-item moment is a cache miss.
On the web, the shop is a CDN server near you and the warehouse is the website’s own server. Fewer misses mean faster pages and less strain on the website, which is why engineers work hard to keep the right content on the nearby shelves.
A real-world example
An online retailer notices that its product images load slowly and that its origin servers handle far more traffic than expected, even though the CDN reports a request hit ratio of only 62 percent for images. Log analysis shows that marketing emails append campaign parameters to image URLs and that the cache key includes the full query string, so each campaign creates new cache entries.
The engineering team removes tracking parameters from the cache key, enables an origin shield in the region nearest the origin and adds stale-while-revalidate to image responses. Within a week the image hit ratio rises to about 96 percent, origin image requests fall by roughly an order of magnitude, and median image load time in distant regions drops noticeably.