Cache Hit Ratio Calculator

Hit ratio = hits ÷ (hits + misses). With hit and miss latencies, the average response time is the hit ratio × hit time + miss ratio × miss time.

Also called: Cache hit rate calculator · CDN offload calculator

  • Last updated
  • Formula tested against reference values

Your numbers

Result

Hit ratio
—

Calculating…

Miss ratio
—
Total requests
—
Average latency
—

How to use this calculator

  1. Enter or choose cache hits.
  2. Enter or choose cache misses.
  3. Enter or choose latency on a hit.
  4. Enter or choose latency on a miss.
  5. 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

  1. Hit ratio: 9,500 ÷ 10,000 = 95%.
  2. 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.