Skip to content

Cache Hit Ratio Calculator

Work out a cache hit ratio from hits and misses, the average response time it gives, the load left on the origin and the transfer cost a CDN or cache saves.

Calculator Details

Average response time:43 msSee results ↓

Enter the hit ratio, or the hit and miss counts from your cache’s statistics

Share of requests served from the cache

Total requests in the period you want costs for

Response time when the cache has it

Response time when the origin has to answer

Your Results

Average response time: 43 ms

Average response time

43 ms

90% hit ratio, 5.81× faster than no cache

Hit ratio

90%

Miss ratio 10%

Requests to the origin

5,000,000

500 GB

Origin transfer cost

$45

$405 less than with no cache ($450)

A 90% hit ratio gives an average response of 43 ms (5.814× faster than no cache) and sends 5,000,000 requests (500 GB) to the origin, costing 45 instead of 450.

Compare scenarios

Save these inputs as a scenario, change them, and compare the results side by side.

Loading, available in a moment

Average response time by hit ratio

Average response time by hit ratio

Detailed Breakdown

Other hit ratios for 50,000,000 requests
Hit ratioAverageOrigin requestsGBCost
0%250 ms50,000,0005,000$450
50%135 ms25,000,0002,500$225
70%89 ms15,000,0001,500$135
80%66 ms10,000,0001,000$90
90% (you)43 ms5,000,000500$45
95%31.5 ms2,500,000250$22.5
98%24.6 ms1,000,000100$9
99%22.3 ms500,00050$4.5
99.5%21.15 ms250,00025$2.25
99.9%20.23 ms50,0005$0.45

Going from 99% to 99.9% cuts origin traffic tenfold: the miss ratio, not the hit ratio, sets the origin's load.

How This Calculator Works

How it's calculated

hit ratio = hits ÷ (hits + misses)

average time = hit ratio × hit time + miss ratio × miss time

origin requests = requests × miss ratio · origin cost = origin requests × response size × price per GB

Your numbers: 0.9 × 20 ms + 0.1 × 250 ms = 43 ms. 50,000,000 × 0.1 = 5,000,000 origin requests × 100 KB = 500 GB, at $0.09 = $45.

Frequently Asked Questions

How do you calculate a cache hit ratio?

Divide the hits by all lookups: hit ratio = hits ÷ (hits + misses). 950,000 hits and 50,000 misses give 950,000 ÷ 1,000,000 = 95%. The miss ratio is the rest, 5%.

What is a good cache hit ratio?

It depends on what is cached. A CDN serving static files (images, scripts, video segments) often reaches 95–99%; an application cache in front of a database 80–95%; a cache of personalised pages much less. Watch the trend and the miss count rather than a single target.

How does the hit ratio affect response time?

The average is weighted: hit ratio × hit time + miss ratio × miss time. At 90% with 20 ms hits and 250 ms misses, 0.9 × 20 + 0.1 × 250 = 43 ms. Misses dominate: going to 95% brings it to 31.5 ms, and to 99% to 22.3 ms.

Why does a small hit-ratio gain matter so much?

Because the origin only sees the misses. Raising the hit ratio from 99% to 99.9% looks like less than one percent, but it cuts the misses from 1% to 0.1% of requests: ten times less load and transfer on the origin.

How do I find my cache’s hits and misses?

Most caches report them. Redis: INFO stats (keyspace_hits, keyspace_misses). Memcached: stats (get_hits, get_misses). CDNs show a cache hit ratio or hits and misses in their analytics, sometimes by bytes as well as by requests. Choose “Hit and miss counts” and enter them.

How much does a CDN or cache save in transfer costs?

Every hit is a response the origin doesn’t send. The calculator prices the origin’s outgoing transfer: requests × miss ratio × response size × price per GB. The example price is $0.09 per GB (Amazon S3 data transfer out, as of 2026-11-12); the CDN’s own delivery charge is a separate cost not included here.

Is a byte hit ratio different from a request hit ratio?

Yes. The request hit ratio counts requests; the byte hit ratio counts bytes. If large files miss more often than small ones, the byte hit ratio is lower and origin transfer is higher than the request ratio suggests. For transfer costs, the byte hit ratio is the better input.

Included: the hit ratio from a percentage or from hit and miss counts, the weighted average response time, requests and transfer left on the origin in decimal or binary units, and the origin transfer cost at the price you enter (example: $0.09 per GB, Amazon S3 data transfer out, read 2026-11-12; check your provider's current price). Left out: the CDN's own delivery and request charges, tiered transfer pricing and free allowances, different sizes for hits and misses (the byte hit ratio), cache fill and revalidation traffic, latency percentiles (only the average is calculated) and the cost of running the cache.

Cache Hit Ratio Calculator: Hit Rate, Latency and Origin Savings

By FindMySum · Last reviewed

A cache hit ratio calculator turns a cache's hits and misses into the numbers that matter to users and budgets: how fast the average request is, how much traffic still reaches the origin server, and what that traffic costs. Enter a hit ratio, or the hit and miss counts from your cache's statistics, along with the response times for hits and misses.

The hit ratio

A cache answers a request from its own copy (a hit) or passes it to the slower origin (a miss). The hit ratio is the share of hits:

hit ratio = hits ÷ (hits + misses)

Redis reports the counts as keyspace_hits and keyspace_misses, Memcached as get_hits and get_misses, and CDNs show the ratio in their dashboards. 950,000 hits and 50,000 misses give 95%.

Average response time

Hits and misses take very different times. The average is weighted by how often each happens:

average time = hit ratio × hit time + miss ratio × miss time

The calculator opens at 90% with 20 ms hits and 250 ms misses: 0.9 × 20 + 0.1 × 250 = 18 + 25 = 43 ms, almost six times faster than sending everything to the origin. Notice that the 10% of misses contribute more to the average than the 90% of hits. That pattern holds whenever misses are much slower than hits, and it is why tuning efforts focus on the misses.

Computer architects use the same idea for CPU caches, where it is called average memory access time: hit time plus miss rate times miss penalty.

Load on the origin

The origin only serves the misses:

origin requests = total requests × miss ratio

With 50 million requests a month at 90%, 5 million reach the origin. This is where the hit ratio's leverage is clearest. At 99%, origin requests fall to 500,000; at 99.9%, to 50,000. Each extra nine divides the origin's load by ten, even though the hit ratio itself barely seems to move. When a cache is sized or configured, the miss ratio is the number that decides how big the origin must be.

Transfer costs

Data leaving a cloud origin is usually billed per gigabyte. The calculator multiplies the origin requests by the average response size and the price per GB. With 100 KB responses, the 5 million misses send 500 GB, which at the example price of $0.09 per GB (Amazon S3 data transfer out, November 2026) costs $45.00, against $450.00 if every request went to the origin. Enter your provider's price and your average response size under the advanced options.

Two conventions matter here. Data sizes can be decimal (1 KB = 1,000 bytes, 1 GB = 10^9 bytes) or binary (1 KiB = 1,024 bytes, 1 GiB = 2^30 bytes), and providers differ in which they bill, so the calculator lets you choose. And a CDN charges for its own delivery to users; that cost isn't included, because it applies to hits and misses alike.

Raising the hit ratio

Common ways to turn misses into hits:

  • Give the cache enough memory for the working set, the data requested often enough to be worth keeping. An eviction count that keeps rising is a sign it is too small.
  • Cache for longer where the data allows, using validation (ETag, Last-Modified) to refresh cheaply instead of refetching.
  • Normalise cache keys. Strip tracking parameters, sort query strings and avoid varying on headers or cookies that don't change the response.
  • Serve stale content while revalidating so an expiring entry doesn't send a burst of misses to the origin.
  • Cache negative results (a "not found" answer) for a short time, so repeated lookups for missing keys don't all reach the database.

Measure before and after: the hit ratio, the average and tail latency, and the origin's request rate.

More questions

What lowers a cache hit ratio?

Too little memory for the working set, so useful entries are evicted; time-to-live values shorter than the data really needs; cache keys that include needless detail such as tracking parameters or cookies, which split one object into many; and traffic that is genuinely unique, such as personalised pages or search queries.

What is a cold cache?

A cache that has just started or been cleared and holds nothing yet, so almost every request misses. Its hit ratio climbs as popular items are fetched. After a deployment that flushes a cache, the origin briefly sees close to full traffic; warming the cache first or rolling the change out gradually avoids the spike.

Does a higher hit ratio always mean a better cache?

Not always. You can raise the hit ratio by caching longer, at the cost of serving stale data, or by caching only cheap objects while expensive ones still miss. The figure to optimise is usually the total origin work or the user-facing latency, which this calculator derives from the hit ratio.

What is average memory access time?

The CPU-cache version of the same formula: average memory access time = hit time + miss rate × miss penalty. It is equal to the weighted average used here when the miss time includes the time spent checking the cache first. Computer architecture textbooks use it to compare cache sizes and levels.

How does a cache stampede happen?

When a popular entry expires, many requests miss at the same moment and all go to the origin to rebuild it. Request coalescing (letting one request refill the entry while others wait), serving stale content while revalidating, and adding randomness to expiry times all prevent it.

Sources

This article explains how the calculator works and is general information, not financial, tax, legal or medical advice. Rules change; check the sources above or a qualified professional before you act.

Spotted a wrong result or a bug? Report a problem

May we count your visits with Invoker Analytics? It keeps a random visitor number in your browser. Your calculator inputs are never sent. Privacy policy