Seems like cache age won't work properly

i am on a free plan and from my origin server i tell cache control to stay in cache for 60 days (php: header(‘Cache-Control: max-age=5259487’); )

but it seems like CF does’nt cache it for 60 days, for example i had an file that i requested last week, after that i it was in cache because response headers show me:

cf-cache-status : HIT
age : 10242
expect-ct : max-age=604800, report-uri=“

But today i requested the same file again and got a MISS on cf-cache-status
I’m pretty sure this file was requested every day in the past week, but still i got an MISS.
Ofcourse, after my MISS i got an HIT and file is in cache (again?)

Did i misconfigured something? or maybe there is an max-age of a day for the free plan perhaps, what i don’t know about?

The configuration is correct, being on the free plan (but not even on higher paying plans, just higher cache priority) means that there is no guarantee your file stays in the cache for the specified amount. If the file is small enough on a less used POP it may stay there if the capacity is available, but as soon as a file with higher priority (more reqs, higher plan, newer added date, etc.) needs the space your file is evicted.

There is no minimum time for which the cache is guaranteed, it would even be technically possible (while extremely improbable under normal circumstances) it won’t even be added and requested each time.

oke, but is’nt there a way to make sure the file stays in the cache for period i configured with Cache-control?
When i would upgrade to PRO plan for example, would this work?

It would have probably less chance of being evicted, 100% chance will never happen, be it Cloudflare or a competitor. The higher the plan the higher the priority, the higher the probability it will stay in cache.

oke thanks for your quick response. i will upgrade to PRO and will keep an eye of the bandwith analytics.

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