Cache being DYNAMIC even with cache rule enabled

The content that is being served by my php code is a static jpeg(image/jpeg) with Cache-Control: public, max-age=3600. I used the the trace tool to see if my cache rule was being hit and it in fact is. Rule in question:
{
“step_name”: “6ae3133d287d445a875ec85e0b4b3032”,
“type”: “rule”,
“matched”: true,
“action_parameter”: {
“cache”: true,
“edge_ttl”: {
“mode”: “override_origin”,
“default”: 86400
},
“cache_key”: {
“ignore_query_strings_order”: true
},
“origin_error_page_passthru”: false
},
“expression”: “(http.host eq "MYDOMAIN" and starts_with(http.request.uri.path, "/proxy/"))”,
“description”: “classic.lunia.com.br”,
“action”: “set_cache_settings”
}
As I said before I used the trace function within the dashboard and it showed me that the rule in fact hit and I’m still getting DYNAMIC.

You shouldn’t even need a cache rule to cache images. Do you have Development Mode enabled?

I do not. The craziest part is that other portions of my website are being cached properly but this one rule refuses to get cached. This will be a json once I figure out what’s going on and temporary I have swapped the return time to a jpeg for testing.

https://classic.lunia.com.br/proxy/news/get

Hi there,

On the mentioned address classic.lunia.com.br the only asset not cached has cache control headers preventing it, and it’s not covered by your rule:
Screenshot 2024-03-13 at 12.46.15

But since you shared a rule that applies to the path /proxy, I assume this is not the correct address.
Can you share the link to the specific asset not cached, so we can analyze it?

Take care.

1 Like

Hi mcorreia,
I specified the url above. I did some more testing with different HTTP types and ended up learning that cloudflare only caches HEAD/GET… Lesson learned :slight_smile: It works as intended now. It was user error. haha

2 Likes

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