Cloudflare is so confusing

They say in their term. Their CDN is designed to cache html pages and anyone who use Cloudflare CDN mainly to cache images, videos, executable (AKA non-html content) are in violation of their terms.

Then you look at their doc about what/how they cache Default Cache Behavior · Cloudflare Cache (CDN) docs

and you see they cache everything (mp3, mp4, …) but html by default. So they don’t cache html but they cache everything else.

How does that make any sense?

Then you see so many post on community cloudflare and reddit of people having their account suspended because their images/video/executable has been cached and this was in violation of cloudflare terms (at least after a certain amount of bandwidth). Even though it’s the default cache behaviour from Cloudflare itself.

Can someone explain to me because i don’t get it.

2/ Also, if my website is in but all the images, videos are from another domain specialized to serve image/videos. Like, Does cloudflare would cache the image/video from domain2 ? like <img src=“

mp3 and mp4 are not default cached file types. HTML isn’t cached because most websites have some level of dynamic content.

Most of those posts are from people disingenuously running sites that host things like pirated anime videos running TBs or PBs of content a month through Cloudflare in my experience. Occasionally it’s an honest mistake and they don’t understand that the restriction is on proxied content regardless of whether it is cached or not… but most of the time the operators are a waste of oxygen.

Cloudflare offers services for serving large volumes of non-HTML content…R2 and Stream among others.

If you try to build the next youtube or a file locker you need to pay for the services associated with them accordingly. If you’re running a small website Cloudflare doesn’t care if 98% of your content is pictures of your cat. I’ve seen plenty of ‘real’ businesses and popular websites operate on a free or pro plan.

Cloudflare is a transparent proxy, if is proxied that traffic (cached or not) is transiting the Cloudflare network and is subject to their ToS.

Cloudflare is nominally a CDN. It’s one of > 100 services they provide and caching is, from a technology perspective, among the least interesting things they do.

1 Like

Perhaps an example will help…

I love Dee Snyder. Twisted Sister was awesome back in the day (OK they’re still awesome). If his website designer Don would finally take my advice and move their website onto Cloudflare, I’d probably suggest the Pro plan. Or maybe the Business plan if they had some concerns that warranted it.

If Twisted Sister had a new album coming out and they planned to post the new mp3 of their ‘hit’ single. Well, as much as I love Dee I might be skeptical as to how well it would do (no offense Dee, I live nearby and I’m happy to hang out and chill if you want). But if I’m Don, and Dee thought I was wrong and this was going to be a new smash hit, I’d recommend they invest some of that sweet, sweet We're Not Gonna Take It cash into storing the new single in R2. And maybe any back catalog songs on the site as well for their well deserved resurgence.

Done and dusted.

It’s not rocket surgery.


Thanks for your reply

This is exactly what i don’t get.
Let’s say i have <= homepage of my website.
In this i have image and video which are hosted on another domain (domain 2)

So i create a rule to cache

But because my image/video are hosted on another domain (domain 2) specialised in hosting image/videos. Domain2 is not proxied through Cloudflare. It’s not even my domain. They are just link in the src of image.

I don’t get why would i be in violation. Cloudflare cache index.html from domain1. Deliver the index.html to users. Once user receive index.html, they download the image/video from domain2 (so not passing through cloudflare). Why would Cloudflare care ?

If it’s proxied it’s potentially a ToS violation. You have just indicated it isn’t proxied.

You wouldn’t be. Well not of Cloudflare’s ToS anyway.

They don’t?

1 Like

ah okay. good then