Using Cloudflare to cache millions of dynamic pages

I have a site where users can create their personal profile which is a public page. Most of the time, this public/profile page doesn’t change, so i guess Cloudflare would cache it automatically, right? and take 100% of the load away from my server?

But sometimes, users modify their profile. Does Cloudflare automatically detect/change this cached page with the new more up-to-date page?

I guess in the million of pages range, you should go for the enterprise plan right?
What is the limit of the number of page you can cache in the free plan?

2/ Also, second question. What is the best way to store million of json files which can change on a daily/hourly basis?
Basically, what i want to do is instead of serving my API from my server. I was thinking about generating the JSON once for a specific profile/page. And then push it to Cloudflare. So every JSON files are served from Cloudflare, not my server.

And my frontend load those JSON from Cloudflare and display the data.
Basically the response instead of coming from my server come from Cloudflare.

Is this possible? is this a common use case of Cloudflare? how would you do it?

No. Cloudflare does not cache HTML automatically.

No. Even if you were to get Cloudflare to cache those millions of pages, most of them will get evicted due to lack of use.

No. How would Cloudflare detect this, if it’s only using the cached version? You would have to trigger a Purge By URL if someone updates their page:

https://api.cloudflare.com/#zone-purge-files-by-url

Not necessarily. It may help some, but not much if the pages are rarely accessed.

No limits on caching for a website. Again, most of that will not stay in cache.

Probably Workers KV:

Second choice, R2:

4 Likes

Thank you for your answer. I have a better understanding of Cloudflare now

2 Likes

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