While accessing a webpage, sometimes, a resource shows "MISS" in header when it should be cached by Cloudflare

Hi All,

I am facing intermittent issues with Cloudflare caching. I constantly check the stats via GT Metrix as my site is new, and that is how I found this issue.

I am using Autoptimize (AO) for minification etc. The AO css/js files on my website are cached by CF, but still, sometimes I see that the files are MISSed on Cloudflare even when the max-age is quite high (1 year). This leads to an increase in load times.

Over time I have also realized that there is no particular pattern as it can happen any time and with any file/resource.

Can someone help me to explain this?

Regards,
Ayush

Cloudflare purges cached items as needed, there is no particular guarantee that your content will be cached, especially if there isn’t a high demand.

1 Like

Thanks @thedaveCA for the prompt reply. This is weird as suppose if the items/resources are purged randomly, there will be situations when there will be high load times leading to high bounce rate too.

CF has provision to set the cache control times. Don’t you think Cloudflare should respect the time set by the user, rather than purge the resources/items randomly?

Resources aren’t purged randomly, but rather, as needed. It is not necessarily predictable from an individual customer’s perspective. As a rule, the more a particular object is used, the more likely it will be retained for a longer period of time.

And no, I don’t think Cloudflare should unilaterally store content indefinitely based on your headers unless you have purchased a certain amount of space (which is not, to my knowledge, something that Cloudflare offers).

Ultimately Cloudflare only has a certain amount of storage available which needs to be shared across the entirety of their customers.

3 Likes

Thanks @thedaveCA for the detailed answer. Really appreciate it. I will wait for some time to see if anyone else wants to come into this discussion.

:wave: @ayush0787,

What @thedaveCA said is correct.

— OG

1 Like

This topic was automatically closed after 30 days. New replies are no longer allowed.