I’m trying to cache some dynamic pages (using Cache page rules) on Cloudflare (for logged out users only) which I have set to cache for 3 days and if the pages change I am purging the individual files from cache using a script and the API.
However the cache isn’t lasting anywhere near 3 days even though I am not purging the pages.
Example page - https://icdb.tv/match/109280-Crystal-Palace-v-Manchester-United
Often I get a MISS then a refresh gives me a HIT but then on another browser or PC I get a MISS again and I have no idea why. At the bottom of the page I have added "Page Generated At: [time]. to try and help me see what’s going on but I’m still unsure.
Setting the cache to last for 3 days doesn’t guarantee that it will. Cache for pages will be evicted if there’s not a lot of traffic, and generally prioritized based on plan level too.
Also keep in mind that caching occurs by datacenter too. So if someone hits your site from Australia, it’s then cached in that region, but if another user then hits it from the UK, they’re not going to get a cache.
Thanks for that. I’ll see how it is at the weekend when my site is usually busiest.
Although I understand what you are saying about the datscenters, when I was testing, both devices where in the UK on the same IP so presumably using the same DC.