Cache hit ratio: what it measures per CDN
· sitewarm
A cache hit ratio looks like one number. In the documentation of the CDNs below it is several: one page divides by cacheable requests, one by all requests, one by hits to misses, one counts bytes instead of requests, and one gives no formula. This article puts the definitions side by side in the vendors' own words and lists what each page leaves unstated.
Everything here comes from the vendors' documentation, read on 2026-10-24. CDNs that are not covered here were not verified. The example counts are invented to show arithmetic, and are not from a real site.
Why the same name gives different numbers
A hit ratio is the number of requests (or bytes) served from cache, divided by something. The something is what differs. It can be every request, only the requests that could have been cached, or hits plus misses. Requests that bypass the cache, requests that fail, and requests that need a check with the origin can each be in or out. A vendor page that does not say which is leaving the reader to guess.
For the status words these definitions rest on, see cache hit and miss and how to read Age, Cache-Control and X-Cache.
What each CDN's documentation says
Amazon CloudFront
CloudFront's monitoring page lists a metric called Cache hit rate among the additional metrics, which must be turned on for each distribution and carry an additional cost. It defines the metric as "the percentage of all cacheable requests for which CloudFront served the content from its cache", and adds that "HTTP POST and PUT requests, and errors, are not considered cacheable requests."
A separate CloudFront guide to improving the ratio words it more loosely, as the proportion of viewer requests that are served directly from the CloudFront cache instead of going to the origin servers. The metric page is the definition of the metric. The guide is a plain-language description.
Unit: requests. Denominator: cacheable requests, with POST, PUT and errors stated as outside it.
Fastly
Fastly's historical stats reference describes the hit_ratio field in one line: "Ratio of cache hits to cache misses (between 0 and 1)." The same page lists related fields separately: hits ("Number of cache hits"), miss ("Number of cache misses"), errors ("Number of cache errors") and pass ("Number of requests that passed through the CDN without being cached").
The page does not say whether passes or errors are part of the ratio, and it does not say whether the unit is requests or bytes. Treat any formula you write for it as your own inference rather than Fastly's.
Google Cloud CDN
Google's Cloud CDN logging page lists Cache hit ratio as a core metric on the predefined dashboards, and defines it as "the ratio, as a percentage, of requests served directly from the Cloud CDN cache versus the total number of requests."
The page lists the log fields cacheHit and cacheLookup and uses them in filters, but does not define them in the way a formula would need. It does not say what the "total number of requests" contains. Cloud CDN exports monitoring data to Cloud Monitoring, and the metric list there was not verified for this article.
Unit: requests. Denominator: the total number of requests, as the page words it.
Azure Front Door
Azure Front Door (Standard and Premium tiers) documents a metric called Byte Hit Ratio rather than a request-based one. Microsoft describes it as "the percentage of traffic that was served from the Azure Front Door cache, computed against the total egress traffic", and gives the formula as (egress from edge - egress from origin) / egress from edge.
- The page states two cases that are left out of the calculation: caching explicitly disabled through the Rules Engine or query string caching behavior, and a
Cache-Controldirective ofno-storeorprivate. - The metrics reference lists no ratio metric for the classic tier.
- Per-request logs carry a Cache Status field. Microsoft documents
HITandREMOTE_HITas served from the cache,MISSas served from the origin, andPARTIAL_HITas a response where some bytes came from the edge cache and others from the origin. The pages read do not turn these into a request-based ratio.
Unit: bytes. Denominator: total egress from the edge, with the exclusions above.
Cloudflare
Cloudflare's cache analytics page splits traffic into Served by Cloudflare and Served by Origin. Served by Cloudflare "indicates content served by Cloudflare that did not require contacting your origin web server." The page has two views. Requests is the default and Data Transfer is described as useful for cost analysis.
- Revalidated requests are counted differently by view. In Data Transfer they count as Served by Cloudflare, because the response body is served from cache. In Requests they count as Served by Origin, because Cloudflare still contacts the origin.
- The page says the Requests summary is "based on a sample of requests, not the full dataset", with totals extrapolated from the sample. It does not say whether the Data Transfer view is sampled.
- The page gives no formula and does not mention
DYNAMICorBYPASS, so it does not say whether those requests are in the totals. For what those statuses mean, see the Cloudflare cache responses page.
Unit: requests or bytes, depending on the view. Denominator: not stated as a formula.
The definitions side by side
| CDN | Unit | Denominator as the page words it | Stated exclusions | Not stated on the page |
|---|---|---|---|---|
| CloudFront | Requests | All cacheable requests | POST, PUT and errors are not cacheable | What else counts as cacheable |
| Fastly | Not stated | Cache hits to cache misses | None stated | Whether passes or errors count; requests or bytes |
| Google Cloud CDN | Requests | The total number of requests | None stated | What the total contains; cacheHit and cacheLookup are not defined |
| Azure Front Door (Standard, Premium) | Bytes | Total egress traffic from the edge | Caching disabled by rule or query string behavior; no-store and private | A request-based ratio |
| Cloudflare | Requests or bytes, by view | Not given as a formula | Revalidated requests are counted differently by view | Whether DYNAMIC and BYPASS are in the totals; sampling in the Data Transfer view |
How the definition moves the number
The counts below are invented to show the arithmetic. They are not from a real site and they are not any vendor's formula. Suppose a CDN received 1,000 requests: 700 were served from cache, 100 went to the origin as misses, and 200 could not be cached at all.
| Ratio divides cache hits by | Result |
|---|---|
| All 1,000 requests | 70% |
| Only the 800 requests that could have been cached (hits plus misses) | 87.5% |
Same traffic, two different numbers. A third number is possible if the unit is bytes rather than requests, because the hits and the misses may be different sizes. None of these is wrong. They answer different questions, which is why a ratio only means something next to its definition.
Before you compare two ratios
- Check the unit. A request-based ratio and a byte-based ratio can differ on the same traffic.
- Check the denominator. Find out whether uncacheable, bypassed, failed and revalidated requests are in it.
- Check whether the figure is sampled or complete, and over which time window.
- Compare a ratio only with another from the same CDN and the same definition. Across CDNs, compare the definitions first.
What a ratio does not tell you
A ratio is an aggregate. It does not say which URLs missed, and a single page that never caches can sit inside a ratio that looks fine. For a single page, the response headers from one request show what the cache did with it. For a CDN's own wording on which responses are cacheable, read its caching documentation.
Where sitewarm fits
sitewarm requests pages from your sitemap, up to the scan's URL limit, and reports the cache state the CDN returns for each one, with the vantage point it was measured from.
Frequently asked questions
Is there one standard formula for cache hit ratio?
Not in the documentation read for this article. The five vendors define it with different units and denominators: cacheable requests, all requests, hits to misses, total egress bytes, or no formula given. See cache hit ratio.
Does a hit ratio count requests or bytes?
It depends on the CDN. CloudFront and Google Cloud CDN define request-based ratios. Azure Front Door documents a byte-based one. Cloudflare's cache analytics has a Requests view and a Data Transfer view. Fastly's one-line definition does not say.
Do uncacheable requests count in the ratio?
It depends on the CDN. CloudFront says POST and PUT requests and errors are not cacheable requests. Azure Front Door leaves out traffic where caching is disabled or Cache-Control is no-store or private. Google Cloud CDN words the denominator as the total number of requests. Fastly and Cloudflare do not say on the pages read.
Is a higher hit ratio always better?
A ratio describes how much was served from cache. It does not say whether the right responses were cacheable, and it hides which URLs missed. Read it with its definition and with per-page cache status rather than on its own.
References
- Amazon CloudFront: View CloudFront and edge function metricshttps://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/viewing-cloudfront-metrics.html
- Amazon CloudFront: Cache hit ratiohttps://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/cache-hit-ratio.html
- Fastly: Historical statshttps://www.fastly.com/documentation/reference/api/metrics-stats/historical-stats/
- Google Cloud CDN: Logginghttps://docs.cloud.google.com/cdn/docs/logging
- Microsoft Azure Front Door: Monitoring data referencehttps://learn.microsoft.com/en-us/azure/frontdoor/monitor-front-door-reference
- Microsoft Azure Front Door: Monitor Azure Front Doorhttps://learn.microsoft.com/en-us/azure/frontdoor/monitor-front-door
- Cloudflare: Cache analyticshttps://developers.cloudflare.com/cache/performance-review/cache-analytics/
- Cloudflare: Cloudflare cache responseshttps://developers.cloudflare.com/cache/concepts/cache-responses/
See the cache state your CDN returns for each page
sitewarm requests pages from your sitemap, up to the scan's URL limit, after a deploy and reports the cache state the CDN returns for each one, with the vantage point it was measured from.