Nothing getting cached according to the analytics

I’ve got an ASPNET Core MVC project where the HTML is dynamically generated with Razor, but it’s basically static. I set the Cache-Control header to public,max-age=86400. In the CF dashboard I’ve added a Cache Rule to match on the URI using starts with and the start of the relevant paths.

When I refresh the page on my machine I see Cf-Cache-Status: HIT on every request to my domain, but in the Caching overview page for the last 24 hours I’m seeing 883 Served by Cloudflare and 54.32k Served by Origin.

This is with Cache Reserve and Tiered Caching on a Pro subscription.

What am I missing?

And answering my own question, apparently those 54k requests were a verified bot, so that would be Google, and they probably send some kind of cache-busting header or something, right?

Since you’re on a paid plan, you can dig deeper into Cache Analytics to see what those requests are. Make sure they’re “200” responses, rather than 404s, 301/302, since those are unlikely to be cached. That’s usually good enough.

In the above example, if I were to filter on Served by Origin, it’s be just a handful of 200 OK responses, so that’s what I’d start looking at. Just start clicking around on those Filter and Exclude buttons next to each entry to figure out what’s getting through to the origin.

1 Like