CalcEngine All Calculators

Cache Hit Rate Calculator

Performance

Enter your total requests and cache hits to instantly see your hit rate, miss rate, and how many requests are reaching your origin server.

Last updated: April 2026

This calculator is designed for real-world usage based on typical engineering scenarios and publicly available documentation.

The cache hit rate calculator tells you what percentage of requests are served from cache versus forwarded to your origin. A cache hit rate of 90% means only 1 in 10 requests hits your database or upstream service — that ratio directly determines your infrastructure cost and response latency. Engineers use this metric to validate CDN configuration (Cloudflare, Fastly, CloudFront), tune Redis or Memcached TTLs, and identify under-caching patterns in API or database layers. A sudden drop in hit rate is often the first signal of a misconfigured cache key, a new query pattern bypassing the cache, or an expiry window set too short. The formula is straightforward: divide cache hits by total requests and multiply by 100. What matters is how you instrument and act on it. A hit rate below 80% in a CDN usually points to low cache-control TTLs or too many unique URLs. A hit rate below 50% in an application cache often means cache keys are too granular or invalidation is too aggressive. This calculator works for any cache layer — CDN edge caches, in-process memory caches, distributed key-value stores, HTTP reverse proxies, and browser caches. Paste in your access log counts or APM dashboard numbers to get an instant read.

How to Calculate Cache Hit Rate

Cache Hit Rate — how it works diagram

1. Count your total requests over a fixed time window — pull this from your CDN dashboard, APM tool, or access logs. 2. Count the requests served from cache (cache hits) over the same window. 3. Divide cache hits by total requests to get the hit ratio. 4. Multiply by 100 to express it as a percentage. 5. Subtract the hit rate from 100 to get the miss rate — this is the fraction of requests forwarded to your origin.

Formula

Cache Hit Rate (%) = (Cache Hits ÷ Total Requests) × 100

Cache Miss Rate (%) = 100 − Cache Hit Rate

Requests to Origin = Total Requests − Cache Hits

Cache Hits     — requests served directly from cache without touching the origin
Total Requests — all incoming requests including hits and misses
Requests to Origin — misses that are forwarded to the upstream server or database

Example Cache Hit Rate Calculations

Example 1 — CDN serving a marketing site

Total Requests:  100,000 / hour
Cache Hits:       94,000 / hour

Hit Rate  = (94,000 ÷ 100,000) × 100 = 94.00%
Miss Rate = 100 − 94.00             =  6.00%
Origin load: 6,000 req/hr  →  only 1.67 req/sec reach the origin server

Example 2 — Redis cache for an API endpoint

Total Requests:  50,000 / hour
Cache Hits:       32,000 / hour

Hit Rate  = (32,000 ÷ 50,000) × 100 = 64.00%
Miss Rate = 100 − 64.00             = 36.00%
Origin load: 18,000 req/hr  →  indicates TTL is too short or cache keys are too specific

Example 3 — Database query cache after tuning

Total Queries:   200,000 / hour
Cache Hits:      188,000 / hour

Hit Rate  = (188,000 ÷ 200,000) × 100 = 94.00%
Miss Rate = 100 − 94.00               =  6.00%
DB queries avoided: 188,000/hr  →  ~94% reduction in database read load

Tips to Improve Your Cache Hit Rate

Notes

Frequently Asked Questions

What is a good cache hit rate? +
For a CDN serving static assets, 95%+ is the target. For dynamic API caches (Redis, Memcached), 80–90% is healthy. Anything below 60% usually means cache keys are too granular, TTLs are too short, or invalidation logic is firing too aggressively. The right target depends on your workload and how expensive a cache miss is — measure latency and origin cost alongside the raw hit rate.
How do I measure cache hits and misses in production? +
For CDNs, check the dashboard — Cloudflare, Fastly, and CloudFront all surface hit/miss counts directly. For Redis, run INFO stats and read keyspace_hits and keyspace_misses. For Nginx, log the $upstream_cache_status variable. For browser caches, Chrome DevTools Network tab shows "from cache" vs "from network" for each request.
What causes a sudden drop in cache hit rate? +
Common causes: a deploy that flushed the cache without warming it back up; a new query parameter being added to URLs that creates unique cache keys for what was previously one entry; a TTL reduction; or a surge in first-time users hitting uncached personalised content. Segment your hit rate by route and time of day to isolate the pattern quickly.
Does cache hit rate affect SEO or Core Web Vitals? +
Indirectly, yes. A high CDN hit rate means lower Time to First Byte (TTFB), which directly improves Largest Contentful Paint (LCP) — a Core Web Vitals metric Google uses for ranking. Pages served from cache edge nodes respond in single-digit milliseconds vs. hundreds of milliseconds from origin. Use the Latency Budget Calculator to model the impact on your overall request latency.
What is the difference between cache hit rate and cache hit ratio? +
They are the same metric expressed differently. Cache hit rate is the percentage form (e.g. 90%), and cache hit ratio is the decimal form (e.g. 0.90). Most monitoring tools use "hit rate" or "hit ratio" interchangeably. When comparing across systems, confirm whether a vendor reports the value as a percentage or a decimal to avoid misreading a 0.90 ratio as 0.90%.