Have you looked at Cloudflare Stream pricing? You can’t be sure that the files will remain in the cache, especially at 500MB each which is at the top end of the maximum size.
There is no guarantee, they try to honor your cache-control header, but if they have other files with higher priority the files will be evicted without notice.
As @Matteo mentioned, streaming looks much more cost effective. Remember that not every edge server at every Cloudflare datacenter shares their cache. You could very well have videos purged pretty quickly and need to be pulled from S3 quite frequently.
If you are looking at building a streaming service to use Cloudflare you really should have a discussion with our Enterprise sales team. In addition to having access to advanced features and configuration options which aren’t available on self service plans, Cloudflare solutions engineers can help provide guidance on best practices, bandwidth alliance partners and other options which can help you control costs and maximize performance for your end users.
+1 on Bandwidth Alliance partners. For only 5GB of data, you can host that just about anywhere for dirt cheap.
Digital Ocean is a partner, and their Spaces service is S3-compatible with built-in CDN. Combine that with Cloudflare, and your cost should be $5/month.
Or am I missing something? I see Spaces includes 1TB of bandwidth, but I’m assuming this waived if it’s going through Cloudflare.
Unfortunately, it looks like they still don’t support CNAMEs. Though your cost still comes to $5/month which includes 1TB outbound, and another $10/month per additional TB.
EDIT: Reading the quote more closely, they say “TO” Spaces. It doesn’t say “FROM” Spaces is an issue. Regardless, they say their CDN eliminates this limit.
There is to note that the CDN counts as outbound obviously, but also the CDN fill counts, so the first request at each edge node will incur in double bandwidth cost.
I’m also not excited that you need to add a blocking rule to stop someone using your domain as a CNAME for their files, such as: sub.example.com/files/NOTMYBUCKET/movie.mov
This can probably be done through Firewall Rules to block a URI that doesn’t contain your subdomain and your bucket name.