Is it allowed to cache .m3u8 and .ts files here in Cloudflare for live streaming?

What is the name of the domain?

olimppi.us

What is the issue you’re encountering

I’m planning on implementing a robust live streaming application that accepts 10,000 viewers/spectators. But before doing such stuff, I’d like to make sure it’s really permmited here to cache .m3u8 and .ts chunks. The live streams are supposed to last about 72h. It’ll be one streaming per week, totalizing 288h of streaming (almost 518GB in files generated every month). With it, I’m foreseeing generation of about 51,840 chunks of .ts to be hit/requested (directly from my server) only once, and then they’ll be requested from Cloudflare edge (via caching). The caching rules are being thought to be like this: [ { “expression”: “(http.request.uri.path contains ".ts")”, “action”: “cache”, “cache_ttl”: 259200 // 72 horas }, { “expression”: “(http.request.uri.path contains ".m3u8")”, “action”: “cache”, “cache_ttl”: 10 // 10 segundos } ] . My thought is: the first access will hit my server directly. Now, considering the next 9,999 requests (users), all of them will access the .m3u8 as well as the .ts chunks from the edge, right? The intention here is to reduce drastically bandwidth costs from Oracle. If it’s not really allowed, what do you recommend instead in this scenario?

So yes, you can distribute your stream via Cloudflare, but not for free.

Thanks for the clarification! Could you share which Cloudflare plan (Business or Enterprise) would be best suited for this live streaming scenario, with ~10,000 viewers, ~500GB/month, and ~6TB/year growth? Also, do you have any ballpark costs or recommendations on whether I should look at Cloudflare Enterprise or go straight to a specialized CDN like Akamai or Bunny.net instead? Any real-world experience or advice would be highly appreciated!

The obvious candidate for “best suited” is Stream. Stream is Cloudflare’s dedicated solution for distributing videos.

Among the options, this will most likely be the most expensive, but also most simple to set up. All you need to do is basically stream via a client like OBS that will send the stream to Cloudflare and then include the stream on your website.

Paygo pricing is 5$ per 1000 minutes stored (per month) and 1$ per 1000 minutes watched, but with the usage you estimate you are well within Enterprise pricing, which is individually negotiated. I have no idea how much to expect for your usage, you’d need to contact Cloudflare sales for that.

The alternative is that you use Cloudflare for “dumb” file distribution as you’ve explained above. You upload the files to you own server, and Cloudflare pulls each file from there exactly once and saves it for however long you want.

Estimating exact costs depends mostly on how distributed your viewers are in location and time, but my best estimate is that it’s peanuts compared to Stream paygo pricing. However, with the traffic you expect, you’ll probably be asked to sign up for Enterprise anyway.

So, contact Cloudflare sales and get quotes for both scenarios. If there isn’t much of a price difference, Stream seems to be the obvious solution.

I have no idea as to what costs you can expect, but I don’t see why you wouldn’t ask multiple competitors for quotes.

1 Like

I tried to contact them via Entre em contato. But I got no response.