A closer look at cache behavior

Cloudflare today announced Cache Analytics, a new tool designed to give customers deeper visibility into how caching and content delivery services are performing for their web properties. The tool is available immediately for all Pro, Business, and Enterprise plan customers.

Caching remains the most effective lever for improving both the performance and economics of serving a website. Because Cloudflare runs data centers within 100ms of 90% of the world's population, pushing content to the edge gets it physically closer to visitors and serves assets from fast SSDs instead of waiting on origin infrastructure to generate responses. At the same time, since origin data transfer is typically one of the largest operating costs for a web service, reducing origin traffic by serving content from cache can meaningfully cut infrastructure expenses.

The challenge has always been visibility. Cloudflare relies on customers to declare what is safe to cache using HTTP Cache-Control headers and page rules—content like a bank balance should never be cached by default. But understanding what's actually being cached, and more importantly what isn't and why, has been difficult. Is a resource expired? Was it ever eligible for cache at all?

Requests versus data transfer

Cache Analytics is built around two complementary views. The default requests view is best for understanding performance, since every request that misses cache results in a performance penalty. The data transfer view is geared toward cost analysis, because most hosts charge for every byte leaving their network; each gigabyte served from Cloudflare is money not spent at the origin. Filters remain active when toggling between these views.

Filtering and time-based analysis

The tool supports filtering by cache status, hostname, path, content type, and other dimensions. This allows operators to isolate a specific subdomain when trying to reduce transfer costs, or focus on the performance of HTML pages alone.

Traffic patterns are also presented over time, which makes it possible to measure the impact of a configuration change or a traffic spike such as a large sale. The data is broken down into traffic served by Cloudflare (handled at the edge without contacting the origin) versus traffic served by origin. One subtlety: revalidated requests—those where Cloudflare checks with the origin but the content is still fresh—count as "served by Cloudflare" for data transfer purposes but as "served by origin" for request counts, since the origin was still consulted.

Understanding cache statuses

An overview section explains why traffic was served from Cloudflare or from origin, with a breakdown by content type. The individual cache statuses point directly at what can be optimized:

  • Dynamic: the request was never eligible for cache and went straight to origin. This is the default for HTML and many other file types. Making more content cacheable via page rules is one of the fastest ways to cut origin data transfer.
  • Revalidated: the asset had expired, but after checking the origin it was still fresh. Significant revalidated traffic suggests Edge Cache TTLs should be increased through page rules or a max-age origin directive, which is one of the easiest speedups available.
  • Expired: the asset was in cache but past its TTL. Extending TTLs, or at least supporting revalidation at the origin, is worth considering.
  • Miss: Cloudflare had not seen the resource recently. Options here include enabling Argo Tiered Caching to check another data center's cache before going to origin, or using a Custom Cache Key to make multiple URLs map to the same cached resource (for example, by ignoring the query string).

Top-N breakdowns and history

The tool also provides "Top N" lists that break down the same data along useful dimensions, such as the URLs that dominate a particular cache status. These lists are most effective when combined with filters—for instance, filtering on "expired" or "revalidated" to identify a handful of URLs driving most of the inefficiency.

Data history varies by plan: Pro customers can access up to 3 days of analytics, while Business and Enterprise customers get up to 21 days. Cloudflare indicated this is the first iteration of Cache Analytics, with plans to add more dimensions and statistics—including data about cache key usage. The company also framed the release as a preview of broader analytics capabilities coming to Zone Analytics, including per-hostname metrics and top-URL views.