Performance
Cache hit ratio
Cache hit ratio is the share of requests answered from cache instead of the origin. It can be counted at the CDN, at a reverse proxy, or in the browser, and each gives a different number.
How it is measured
Divide cache hits by total requests over a window, usually from CDN logs or the dashboard. Decide whether you count by request or by bytes, because a few large downloads can swing a byte ratio while barely moving a request ratio.
Read the cache status header on the response, such as `cf-cache-status` or `x-cache`. Values like HIT, MISS, EXPIRED, and BYPASS tell you why a request reached the origin, which is more useful than the headline percentage.
Worked example
A WooCommerce store behind a CDN reports a 38 percent request hit ratio. The top miss reason is BYPASS on every URL with a `wordpress_logged_in` cookie plus a `?add-to-cart` query. After excluding static assets from cookie bypass, the ratio climbs to 87 percent and origin CPU drops by half.
Product images were already hitting at 99 percent. The gain came from CSS, JS, and fonts that carried a Set-Cookie header and were never stored.
How it differs
Cache hit ratio is a rate of cache answers. Edge cache is the place where those answers are stored. A high ratio says the cache is working. It says nothing about whether the cached copy is fresh, so pair it with an age or revalidation check.
Common errors
Counting only static files and calling the whole site healthy. Letting query-string variants fragment the cache key. Ignoring that HTML on logged-in routes should miss. Using bytes in one report and requests in another. Treating a 99 percent ratio as proof the origin is fast when the 1 percent of misses are your slowest pages.
In practice
Pull a week of CDN logs and sort misses by path and reason. Fix the loudest cause first, usually cookies, cache-busting queries, or a missing Cache-Control. Recheck the ratio after a day so it covers a full traffic cycle.