What is Cache Hit?
A cache hit occurs when a requested resource is found in a CDN edge cache and served directly to the client, bypassing the origin server entirely.
A cache hit is the condition in which a content delivery network (CDN) edge node holds a valid copy of a requested object and delivers it to the requesting client without forwarding the request to the origin server. This is the ideal outcome in a caching system because it minimizes latency, reduces load on the origin, and lowers bandwidth costs. The object must be present in the cache and not expired or marked as stale according to the cache control headers (e.g., Cache-Control, Expires) set by the origin.
When a client request arrives at an edge server, the server first checks its local cache storage. If the requested URL matches a stored object and the object's freshness lifetime has not expired, the server returns a 200 OK response with the cached content, often including an Age header indicating how many seconds the object has been cached. The server does not contact the origin for validation unless the cache has a stale entry that requires revalidation via If-Modified-Since or If-None-Match headers. A cache hit reduces the round-trip time from potentially hundreds of milliseconds to single-digit milliseconds.
Cache hit ratio is a key performance metric for CDNs. It is calculated as the number of cache hits divided by total requests over a given period. High cache hit ratios (typically above 90% for static content) indicate efficient caching policies and good cache utilization. Factors that reduce cache hits include low TTL values, unique per-user URLs, query string variations, and cache busting mechanisms. CDN operators tune cache rules, use purge APIs, and implement tiered caching to maximize the hit rate and improve end-user experience.
Key facts
- Cache hit means the requested object is served from the CDN edge without contacting the origin server.
- Response time for a cache hit is typically under 10 ms, compared to 100-500 ms for a cache miss.
- The Age HTTP header reports how many seconds the cached object has been stored at the edge.
- Cache hit ratio = (cache hits / total requests) x 100; above 90% is considered excellent for static assets.
- Stale objects may still produce a cache hit if the CDN revalidates them with the origin using conditional headers.
How it works in practice
Related terms
References
More in CDN & Performance
Apdex Score
The Apdex Score is a standardised metric that measures user satisfaction with application performance by comparing response times against predefined target and tolerable thresholds.
Bandwidth Throttling
Bandwidth throttling is the intentional reduction of data transfer speed by a network operator or service provider to manage congestion, enforce usage policies, or control costs.
Brotli Compression
Brotli is a lossless compression algorithm developed by Google, offering higher text compression ratios than gzip, used by CDNs to reduce page load times.
Cache Invalidation
Cache invalidation is the explicit removal of stored web objects from a cache so that new requests must revalidate or refetch them from the origin server.
Cache Miss
A cache miss occurs when a requested resource is not found in a CDN or proxy cache, forcing the request to be forwarded to the origin server and then storing the response for future requests.
CDN
A CDN (Content Delivery Network) is a geographically distributed network of proxy servers and data centers that deliver web content to users from the nearest edge location, reducing latency and offloading origin servers.
Core Web Vitals
Core Web Vitals are a set of three real-world user experience metrics (LCP, INP, CLS) defined by Google to quantify loading, interactivity, and visual stability on web pages.
Cumulative Layout Shift
Cumulative Layout Shift (CLS) is a Core Web Vital metric that measures the sum of all unexpected layout shift scores during a page's lifespan, quantifying visual stability.
Edge Computing
Edge computing is a distributed computing model that processes data and runs application logic at Points of Presence (PoPs) close to end users, minimizing round-trip latency and bandwidth usage compared to centralized cloud regions.
Image Optimization
Image optimization reduces image file size by selecting modern formats (WebP, AVIF), resizing to display dimensions, and tuning quality, improving page load speed and bandwidth usage.