This may be stupid but when serving files via r2 and the cloudflare cdn, is it really unlimited bandwidth? Like truly uncapped? If so, why doesn't youtube or netflix just host stuff on r2? Wouldn't it just massively bring down server costs?
I thought of doing that using promise.all but what if some images failed to upload and it throw error. so the images will get uploaded will be there for life till I manually delete the uploaded image manually. what is the best approach to handle this scenario.
basically I have a travel package model where I am uploading images and package details.
cloudflarestorage.com subdomains of this domain isn't accessible with some indian ISPs like Jio, if you are locally using Jio or related ISP you have to use vpn or proxy
Workflows is a durable execution engine built on Cloudflare Workers. Workflows allow you to build multi-step applications that can automatically retry, persist state and run for minutes, hours, days, or weeks. Workflows introduces a programming model that makes it easier to build reliable, long-running tasks, observe as they progress, and progra...
Weird, I swear the TOD said that video streaming specifically wasn't allowed on the CDN but then again it's been pretty back and forth in the discussions I've read.
const data = await env.R2_BUCKET.get(objectKey, { range: { offset: part.start, length: part.length } }); if (!data || !data?.body) { logger.error({ partNumber: part.number, offset: part.start, length: part.length }, 'Missing part data'); throw new Error(); } i get thrown cause data won't return, it works locally ! i also tried to retry 5 time with backoff and still nothing
Is there a way to see how much bandwidth is being used per file/folder? Or is it total? Or is there some way for me to collect logs when a file gets hit?
I basically allow users to upload various files and currently there's no bandwidth limit ofc but I want to be able to see which users are heavy users in the case that something needs to happen so knowing which user is using up the most bandwidth would be nice to know
Gotcha, so just to clarify, I'm looking at the dashboard under cache and I can see the paths which got the most traffic, so that's fine, however in my case I'd like to show this to my user as a "Here's how much bandwidth you've used this month" kind of statistic. So for each user their various files would have a path of like '/{user_id}/{folder_id}/somefile.jpg' which means I just need to aggregate the banwdith used by all paths that start with the specific user's ID.
Is it possible to retrieve that info via some sort of API?
Ah I see, but there's no dedicated simple way I guess? Also I know nothing about graphql tbh lol
I used to use BunnyCDN and they have a log forwarding option so it was pretty easy to figure out how many times a file was viewed, etc, by forwarding the logs to a simple $5 VPS and parsing them and adding them to a db
Oh yeah I wouldn't let them interact with r2 directly, I just want to build an admin dashboard so I can keep track of which user is using how much bandwidth and reach out to them if needed, etc
i have no idea why. i adjusted my cors rules for my bucket. I simply send a signed transaction from my server to the client and the client just cannot use it due to this
So I'm not sure if you remember but you helped me with learning about HLS and serving video files (thanks for that)
I generate the manifest on the fly because I use waf so every time a manifest is requested, I know that the video has been played (or at least preloaded/requested/whatever). But what I don't know is how much bandwidth they used, because if the video file is 1GB lets say and they only watched 1 minute before exiting out, they'll incur less bandwidth than a video file that's 50MB but a user watch the whole thing, even though I've recorded 1 play for each file
So with the way it's being done, I can't do tracking at the layer closest to the user because the manifest file (which is the only 'file' that my server returns) simply links to direct files within the r2 bucket
Yeah bandwidth is not a concern, but I did read some stories about how some guy got reached out by cloudflare to hop on a large contract because he was using like 1-3 petabytes of data
Now I don't see myself even coming close to that, but in the off chance that some power house user uses my service to host their 1GB file that suddenly gets 1 million views, that's a petabyte of data right there, so if cloudflare reaches out to increase costs, I'd like to know who's using all the bandwidth and figure out extra pricing, etc
That's insane haha, I mean like I'm just thinking about worst case scenario because I'm planning on charging a fixed price per 100GB lets say, but I'm not specifying bandwidth limits. But if some power user manages to get their video popular overnight and it gets like 10 million views, that's a lot of bandwidth, so I just want to try to be ready for a scenario like that if cloudflare comes knocking asking for a big contract when I'm still only charging them like a flat $10 a month