Cache MISS with Cache-Control max-age of 12 hours and a rule to cache everything

What is the name of the domain?

What is the issue you’re encountering

Cache MISS with Cache-Control max-age of 12 hours and a rule to cache everything

What steps have you taken to resolve the issue?

Tried REDbot and it states, “This response allows all caches to store it.” and “This response is fresh until 12 hours from now.”

What are the steps to reproduce the issue?

curl -v https://findhumane.com/find_humane/api/get_product_details?product_id=384

I have a single cache rule and it is “Enabled”. The match selection is “All incoming requests” and the cache eligibility is “Eligible for cache”. Everything else is default settings.

My request returns:

< HTTP/2 200 
< date: Fri, 21 Feb 2025 16:49:47 GMT
< content-type: application/json; charset=utf-8
< status: 200 OK
< cache-control: public, max-age=43200
< cf-cache-status: MISS
[...]

Retrying the request many times doesn’t help; it’s always a MISS.

Screenshot of the error

Showing that there’s only one rule and it’s enabled:

I ran the rule trace on the URL and it matches my cache everything rule. From “View rule detail”:

{
  "step_name": "[...]",
  "type": "rule",
  "matched": true,
  "action_parameter": {
    "cache": true
  },
  "expression": "true",
  "description": "Cache everything",
  "action": "set_cache_settings"
}

Screenshot:

Now suddenly it’s showing HIT after dozens of tries! Maybe Cloudflare only starts to cache after a certain number of hits in some time period?

I got a MISS the first time, and a HIT on subsequent requests.

That’s to be expected since the asset is not in Cloudflare’s cache on the first request and Cloudflare needs to go to origin to request it.

2 Likes

I was receiving MISS for over 1 hour, so something else happened than that. I’m guessing Cloudflare caching isn’t deterministic? Maybe there are some thresholds or heuristics used on whether to cache something? Or maybe your curl is special? :slight_smile:

Maybe because you made a request then it registered as something like “more than one user is requesting this, so probably it’s worth caching”

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.