How to use this calculator
- Enter or choose cache hits.
- Enter or choose cache misses.
- Enter or choose latency on a hit.
- Enter or choose latency on a miss.
- The hit ratio updates as you type. Use Copy result or Share to keep it.
Method
Hit ratio = Hits ÷ (Hits + Misses); Average latency = H × Hit latency + (1 − H) × Miss latency
- H
- hit ratio as a decimal
Worked example
- Hit ratio: 9,500 ÷ 10,000 = 95%.
- Average latency: 0.95 × 1 + 0.05 × 50 = 0.95 + 2.5 = 3.45 ms.
9,500 hits out of 10,000 requests is a 95% hit ratio, giving an average latency of 3.45 ms.
What the result means
Look at the miss ratio rather than the hit ratio: going from 95% to 99% hits cuts misses, and load on the origin, by 80%. Misses usually dominate average latency.
Assumptions and limits
- Every hit and every miss takes the average time entered.
- Byte hit ratio (share of bytes served from cache) can differ a lot from request hit ratio when large files are cached less often.
Questions
What is a good hit ratio?
It depends on the cache. Static-asset CDNs often aim very high; application caches with personalised data are lower. Track it over time rather than against a fixed target.
Where do I find hits and misses?
Redis reports keyspace_hits and keyspace_misses in INFO stats; CDNs show cache status in their analytics or response headers.