CDN Cache Analytics and Hit Rates
What you'll learn: How to monitor and interpret CDN cache performance metrics to optimize delivery and reduce costs.
Understanding Cache Hit Rates
A cache hit rate is the percentage of requests served directly from CDN edge caches versus those requiring origin server retrieval (cache misses). Think of it like a store's inventory: a high hit rate means customers find what they need on the shelf (fast, cheap), while misses require ordering from the warehouse (slow, expensive).
The basic calculation:
Cache Hit Rate = (Cache Hits / Total Requests) × 100%
For example, 10,000 requests with 9,500 hits = 95% hit rate.
Key Metrics to Monitor
Cache Hit Ratio: Your primary health indicator. A rate above 90% is typically excellent for static assets. Lower rates may indicate poor Cache-Control headers, excessive cache invalidations, or inappropriate content caching.
Byte Hit Ratio: Measures bandwidth saved. Large files (videos, downloads) make this metric differ from request hit ratio. You might have 80% request hits but 95% byte hits if large files cache well.
Origin Load: Tracks requests reaching your origin. Spikes indicate cache problems—perhaps your Vary header is creating too many cache keys, or ETag mismatches are forcing revalidation.
Time-to-First-Byte (TTFB): Compare edge vs. origin TTFB. Cache hits should be dramatically faster (sub-50ms vs. hundreds of milliseconds).
Using Analytics for Optimization
Review analytics to identify:
- Low-performing paths: URLs with poor hit rates may need better caching headers
- Geographic patterns: Regions with high miss rates might benefit from cache-warming
- Popular stale content: Consider adjusting
stale-while-revalidatepolicies - Cost impact: Origin bandwidth costs directly correlate with miss rates
Key Takeaway: Regular analysis of cache hit rates, byte ratios, and origin load patterns reveals optimization opportunities that improve performance while reducing infrastructure costs—small improvements in hit rate translate to massive savings at scale.