Hacker News new | ask | show | jobs
by MichaelGG 4007 days ago
CloudFlare told me that using them to host images/media isn't allowed. That they do the CDN bits for websites, but not to do excessive non-webpage stuff. Their ToS says something like that.

Maybe that changes for a few K a month?

2 comments

CDNs don't host the files, your servers do. They cache copies of the files across their CDN network and serve the files from their cache until the cache expires, then they go and get the file from you again to rebuild their cache.

As a practical example, you might have an image on your webserver. When it goes viral on reddit, the request for the image hits the CDN first, not your servers (that's why they call it reverse proxying), they see that they don't have a cached version of the file, or their cached version has expired, so the CDN sends a request to your server, copies the file, and then proceeds to serve that file from their cache for the next million user requests or until the cache is set to expire (usually 24 or so hours, more than long enough for the traffic hitting your image url to die down).

Basically, the CDN made it so your actual servers (and thus your host bandwidth bill) served one request. Not 1 million requests.

Now typically you will foot the bandwidth bill for the CDN as well, but Cloudflare has a tiered pricing structure that is well below the rest of the competition. See moot (owner of 4chan) talk about cost savings here: https://news.ycombinator.com/item?id=6682324

Yes I say "host" as a shorthand for "cache so I don't have to serve much".

Just saying that when I contacted them, they were clear that we shouldn't use them for images or media, and their general ToS agrees.

Their enterprise pricing starts cheap so if they throw in "unlimited bandwidth for everything" then it'd be quite a good deal.

There must have been some misunderstanding/miscommunication, if not then Cloudflare has pivoted their business significantly from what my understanding of it was (granted I haven't researched them in over a year).

Media is the primary purpose for CDNs. The performance boost comes from a global network caching the media files so when requests are made for the resources, the end user downloads the media from the nearest CDN node instead of your server that is potentially on the other side of the world. It doesn't matter quite so much to have non-media (such as the page html) served locally because the size of an html page is generally significantly smaller than the media embedded in the page.

From the small amount of research I've done on the Cloudflare service just now, it doesn't seem very transparent how exactly it works. I've found information on 4chan and imgur using them to serve billions of CDN requests, but others saying don't rely on their CDN. So who knows, maybe it's on a case by case basis.

https://www.cloudflare.com/terms Section 10:

...Additionally, the purpose of CloudFlare's Service is to proxy web content, not store data. Using an account primarily as an online storage space, including the storage or caching of a disproportionate percentage of pictures, movies, audio files, or other non-HTML content, is prohibited...

Aren't images and video webpage stuff?
As far as I can tell they go by intent. Hosting a few images and videos for your page is one thing. Hosting an imageboard or video streaming site is another.