API Json Cache Via Page Rule?

I config page rule as follow:

https://domain.com/api/v2/config (json response)
Cache Level: Cache Everything
Edge Cache: 24 hours

User request this api from mobile app. As I log request to this endpoint on my logging system, user still hit this endpoint on my backend system (a lot requests in 24 hours).

So I tried a test case as follow: the first request from a new browser or new device will hit my backend (cache miss), then following request from this browser (device) will be response by Cloudflare (cache hit). So I conclude Cloudflare caching engine is on per browser (device), Is it the right behaviour?

Could I force user only reach Cloudflare (no matter device) without touching my backend system when caching’s still effective (24 hours)? Is it possible?

Just update result after contacting support team.

Caching is per colo, not per device. Not all location will have this content cached. So request still coming to our backend. Edge cache ttl 24 hours doesn’t mean that will cache for 24 hours, if the content aren’t been requested frequently, it’s still be evicted. You can use R2 in order to accomplish this purpose.

1 Like

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