Quick answer
Cache hit rate is the share of requests a cache answers itself instead of passing to the origin server: hits ÷ (hits + misses). At 9,000 hits and 1,000 misses it is 90%. A higher rate means faster responses for visitors and less load on the origin.
Formula: Cache hit rate = cache hits ÷ (cache hits + cache misses) × 100
What cache hit rate measures
Cache hit rate is the share of requests that a cache answers itself instead of passing on to the origin server that holds the original content. A hit is served from the cache, which is fast and costs the origin nothing. A miss means the cache had nothing usable and had to fetch the content from the origin first, which is slower and loads the server.
On a website, the cache in question is usually a content delivery network, or CDN, that stores copies of your files in locations near visitors. The rate is reported per site, per file type or per path. It is also called cache hit ratio; the two names mean the same thing, though one can be written as a fraction and the other as a percentage.
This entry explains the formula, shows a worked example with a CDN, covers why rates are often lower than expected and links the rate to page speed. For the wider topic of how caching works on a site, see CDN cache.
The formula and a worked example
The formula divides hits by all cache lookups, which are hits plus misses.
Sample data: a CDN receives 10,000 requests in an hour. 9,000 are answered from the cache and 1,000 go to the origin.
- Cache hit rate = 9,000 ÷ (9,000 + 1,000) = 9,000 ÷ 10,000 = 90.0%.
- Cache miss rate = 100% − 90.0% = 10.0%.
- Origin load = 1,000 requests, a tenth of what it would be with no cache.
The origin load line is the useful one. Moving from 90% to 95% looks like a small gain, but it halves the traffic that reaches the origin, from 1,000 to 500 requests. The last points of hit rate are worth the most to the servers.
Requests and bytes can disagree
The rate can be counted by request or by bytes, and the two can differ a lot. A request hit ratio treats a 30 KB page and a 200 KB image as equal. A byte hit ratio weights by size, and it relates to bandwidth cost.
Sample data: 10,000 requests in one hour, split by file type.
| File type | Requests | Average size | Hits | Request hit rate |
|---|---|---|---|---|
| Images | 6,000 | 200 KB | 5,400 | 90.0% |
| Scripts and styles | 3,000 | 60 KB | 2,900 | 96.7% |
| HTML pages | 1,000 | 30 KB | 0 | 0% |
| Total | 10,000 | 8,300 | 83.0% |
The calculations: request hit rate = 8,300 ÷ 10,000 = 83.0%. Total bytes = 6,000 × 200 + 3,000 × 60 + 1,000 × 30 = 1,410,000 KB. Bytes served from cache = 5,400 × 200 + 2,900 × 60 = 1,254,000 KB. Byte hit ratio = 1,254,000 ÷ 1,410,000 = 88.9%.
The two figures, 83.0% and 88.9%, answer different questions: the first says how often visitors skip the origin, the second says how much of the transfer the origin avoids. Report both, and report them by file type, because an overall figure hides that HTML pages in this sample are never cached.
Why a hit rate is lower than expected
Most low rates trace back to a short list of causes. The examples are from the documentation of two CDNs, cited in Sources.
- Dynamic content is not cached by default. One CDN's documentation says it does not cache HTML or JSON by default and caches by file extension, not by content type.
- Headers can switch caching off. The same documentation lists
Cache-Controlvalues ofprivate,no-store,no-cacheormax-age=0, aSet-Cookieheader and non-GET requests as reasons content is not cached. - A short lifetime. The other CDN's documentation says the shorter the cache duration, the more often it sends requests to the origin to check for a newer version, so it advises the longest practical
max-age. - Too many cache keys. The cache stores a separate copy for each distinct key. That documentation explains that
parameter1=Aandparameter1=aare stored separately even when the content is identical, and the same goes for parameters in a different order. - Forwarding every cookie or header. If two cookies each have three possible values, every combination can produce a separate request to the origin, up to 3 × 3 = 9 variants per object.
A quick diagnosis: take your ten most requested URLs, look at the status the CDN reports for each, and see which of the five causes applies. Fixing the top ten usually moves the total more than tuning a hundred small files.
How hit rate changes page speed
A hit is served from a location near the visitor and skips the trip to the origin, so it mainly improves time to first byte, the time until the first byte of the response arrives. web.dev gives a rough guide for that metric, measured at the 75th percentile of page loads: 0.8 seconds or less is good, between 0.8 and 1.8 seconds needs improvement and above 1.8 seconds is poor.
The 75th percentile matters because it ignores the fastest three quarters of loads. That produces a sharp effect, which this sample shows. Assume a hit returns in 80 milliseconds and a miss in 900 milliseconds.
| Hit rate | Average time to first byte | 75th percentile |
|---|---|---|
| 95% | 121 ms | 80 ms |
| 90% | 162 ms | 80 ms |
| 80% | 244 ms | 80 ms |
| 70% | 326 ms | 900 ms |
| 50% | 490 ms | 900 ms |
The average changes smoothly: 0.9 × 80 + 0.1 × 900 = 162 ms. The 75th percentile does not. While the hit rate is at least 75%, the 75th percentile falls in the hit group, so it is 80 ms. Below 75%, it falls in the miss group, so it is 900 ms, over the 0.8 second line. A drop from 80% to 70% looks minor in the average, 244 ms to 326 ms, yet it moves the metric that counts from good to needs improvement.
The rule that follows: keep the hit rate for HTML and API responses above 75%, or watch the 75th percentile as well as the average. Static files can usually go much higher.
How to raise a hit rate
Work through these in order, because each is cheaper than the next:
- Lengthen the lifetime of files that rarely change. Set a long
max-ageon images, scripts and styles, and use file names that change when content changes so a long lifetime is safe. - Normalize query strings. Use one case and one order for parameters, and ignore parameters that do not change the content, such as tracking tags.
- Trim the cache key. Forward only the cookies and headers the origin actually uses to vary a response, and keep dynamic and static content on separate rules.
- Cache HTML only where it is safe. Pages that do not vary by person, such as an article, can be cached for a short time. Pages that depend on a login should not be.
- Add a tier. A shield layer in front of the origin collects misses from many locations into fewer origin requests.
Measure after each step, and change one thing at a time so you know which fix moved the number.
What a good hit rate looks like
There is no single target. Static files are expected to have a high rate, while a site that serves mostly personalized HTML will have a low one by design, and that is not a fault. Compare the same file type over time, and treat a drop of more than a few points in a day as a signal to check for a deploy, a new tracking parameter or a header change.
Checking the effect in TapCub
TapCub does not report cache hits; that status lives in your CDN or server logs. What TapCub can show is the result visitors feel, which is the check that a hit-rate change helped.
- Open the real-user timing. In Monitoring › Performance, the Time to first byte card uses thresholds of 800 milliseconds for good and 1.8 seconds for poor, matching the guide above.
- Use the right percentile. Cards can switch among P95, P75, the median and the average. Use P75 to match the thresholds, and compare it with the median to see how far the slow loads are from the typical one.
- Find the pages. Break the figures down by page, country, device, browser and operating system. A page whose time to first byte is high only in one country can point to a cache location problem.
- Separate backend from the rest. Load timing splits one load into backend (time to first byte), network transfer and frontend render, so you can tell a server problem from a heavy-page problem.
- Compare before and after. Note the date of the cache change on Configuration › Annotations, then look at P75 on the same pages afterwards. The page has no previous-period comparison, so the annotation and a screenshot of the earlier figure are the baseline.
If the script is blocked, the page is empty and no server time is substituted. The data comes from visitors' browsers, so it shows what real people experienced.
Sources
- Cloudflare, Default cache behavior (HTML and JSON not cached by default; cache by file extension;
Cache-ControlandSet-Cookierules). Checked 2026-11-22. - Amazon Web Services, Increase the proportion of requests served directly from the CloudFront caches (cache hit ratio) (cache duration, query string case and order, cookies and headers, origin shield). Checked 2026-11-22.
- web.dev, Optimize Time to First Byte (0.8 and 1.8 second thresholds at the 75th percentile). Checked 2026-11-22.
Was this explanation clear?
We use your answers to fix and expand this page.
Couldn’t send. Please try again in a minute.
Thanks for the feedback. We’ll use it to improve this page.You’ve already sent feedback on this page. Thanks.

Customer Experience Consultant
Writes about live chat, visitor conversations, and self-service, sharing practical ways to make customer communication clearer and more effective.