Hmm… looking at the bandwidth costs on Fastly and the Amazon CloudFront (and others) they are pretty much the same as the .09/GB I am paying now
Cloudflare seems to not charge for bandwidth?? Maybe that is the thing to try then. Is there a post on how to hook up Cloudflare for S3 images CDN on Discourse? I see the s3_cdn_url but can’t find instructions on how to use it (other than I need to rebake once I set it up). Looking at Cloudflare it seems like you need to have your own domain since the DNS needs to be changed… so I would have to make a CNAME something like s3-cloudflare.mydomain.com which would point to my S3 bucket IP, and tell Cloudflare to do it’s thing on that URL, and also set s3_cdn_url to that, and then rebake?
Here is a support page I found at Cloudflare which seems to indicate this might work:
I’m using Cloudflare on my Discourse site and it works fine. You basically route all your traffic through Cloudflare and tell it what to process or cache and that’s it. There are a few things to keep in mind though:
Configure Cloudflare to NOT cache anything (set up exceptions using page rules, see below).
Don’t let Cloudflare touch your Javascript - specifically, turn off Rocket Loader.
I’m not sure about Brotli compression yet, I disabled it.
Set up page rules to cache the avatar and upload directories as below (ignore rule #1, it’s site specific).
Cloudflare is currently caching a little over 3TB of data per month for me and it’s serving large graphics pretty fast.
If you’re more interested in a CDN I can also recommend https://www.belugacdn.com/ (I’m not affiliated with them). I use them on a large WordPress platform and performance is good, at a fraction of the cost of some other CDN platforms I looked at (those might be even more performant, but Beluga meets my needs).