Custom domain question

Is there anyway to use a custom domain for R2 Bucket, have the content cached and still require presigned url. This is probably a stupid question since I can not see how content be cached when the url keeps changing but I wanted to give it a try. So, if this is not possible, I am wondering how much of a performance differrence will I get for 540P videos? I have a FastAPI back-end and react native front end IOS-Android software and it has lessons. All of the lessons have 2 to 12 videos and all want to load once you call a lesson. Videos are 540P ( I wanted to make 720P but. smaller better for speed I thought ), and they are about 1mb to 4mb each. I have both solutions working.. meaning I implemented Presigned Url working for the bucket when custom CDN is cancelled, also the public with custom CDN version. I would want to keep the videos private but not at the cost of slowing down a lot. What do you think?
6 Replies
Erisa
Erisa•7mo ago
Not with presigned urls, if you're on a Pro plan you can do something similar with hmac urls
yavuz
yavuzOP•7mo ago
Thanks. I thought so. What do you think performance hit would be uncached with presigned url vs cached with cdn custom domain? I am the only one testing now so I cannot really guess. 1 to 4mb videos, 10 of them in a lesson.
Erisa
Erisa•7mo ago
Depends where the bucket is located and where your users are located
yavuz
yavuzOP•7mo ago
Well, I am the only user now since I am just testing 🙂 Bucket is in US East Coast I think. However, It will be live soon. Maybe I'll look into multiple locations option. What I wanted to learn was if everything is the same ( distance from location etc.. ), for smaller videos like 1-4mb, cached ( custom cdn ) vs. presigned url performance. Since Presigned Url is checking/decoding authorising the url then starts streaming vs... cached ( should be better of course ). Maybe I should try to measure it with code.
Erisa
Erisa•7mo ago
The actual decoding and authorising would be negligible, the bigger concern is that cached copies are local to the datacenter while presigned urls are going to fetch from the original bucket location every single time
yavuz
yavuzOP•7mo ago
I see... Then it does not make sense I guess. Even if users could reach/download the content, app holds it together as one meaningful teaching methodology. So I should let it go. If they want to download PDFs or videos fine. Thanks
Want results from more Discord servers?
Add your server