CloudFlare on top of existing CDN (non-distributed)

Does anyone have experience with using CloudFlare on top of your own CDN? I have a separate domain for my CDN, and all the data currently just sits on my main server where the main website runs. The server is from Linode and is in Dallas, but our user base is all around the world. I’m thinking about putting CouldFlare on top of that CDN to speed up loading static content and media. Is this how CloudFlare is commonly used? Would the free tier be sufficient, or should I aim for some of their paid programs? The total space used on the server by the static content and media is around 400GB, and monthly traffic is around 6TB. I know the best way would probably be using CloudFlare CDN directly, but that would be a huge undertaking to implement.

Any help would be very appreciated, thanks in advance! :slight_smile:

Isn’t that exactly what your CDN should already do?

You can certainly add Cloudflare to it, but if your CDN is not running on your own domain, it won’t do much.

@sandro Thanks for the quick reply!

As I mentioned in the original post, it’s not a real CDN. It’s just a separate domain for the static content and media which runs on the same server as the main website, so it’s not distributed, all the content is stored on just that one server in Dallas. I just wanted to have all our static content on a separate domain, to make it easier if we want to migrate to a real CDN in the future.

All right, but then it’s not a CDN. In that case Cloudflare would certainly add some performance aspects due to its caching.

But also keep in mind, if you only add the separate domain to Cloudflare, you’ll be in violation of point 2.8 of the terms of service. You best merge your “CDN” content back into your main domain and add that altogether to Cloudflare.

As you said you want it separated, you can still have it on a separate hostname. For example, static.yourdomain.com.

Still though, don’t just proxy static in that case but the whole domain, otherwise we are back to 2.8.

Thank you very much again @sandro, you helped a lot!
As I’m thinking about it now, it would probably make total sense to also add the main domain to CloudFlare. Even though the HTML won’t be cached, the latencies still should be better because of optimised traffic routing. And because CloudFlare is so conservative when it comes to caching, it shouldn’t even be as big of a problem as I initially expected.

Still, watch out for 2.8. If you have a dedicated domain which only serves static content you might run into issues because of 2.8. Best to run everything under one domain.

Yes, I looked into the terms of use and saw the part 2.8 you mentioned, thank you for that! I contacted the support to check if it would be possible to make such a setup with the separate domain (while also adding the main domain under CloudFlare). So I’m looking forward to hearing from them, as it would be a lot easier than having to migrate all our static content to the main domain. We would also be willing to go for a paid plan if it would be necessary, and maybe even if it won’t because some of the features like “lossless image compression” sound pretty useful.

Technically no, as that would be a violation of the terms. In reality it might not be that much of an issue, especially if you do not transfer lots of data.

But technically you’d be still in violation as that paragraph is quite clear on how a domain may be used on Cloudflare.

Unfortunately the real exceptions start with Enterprise. Everything else is subject to the same terms.

1 Like

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