Can cloudflare R2 enable custome fine-grained access control?

I want to build a resource sharing site where members can download resources a certain number of times, so I need access to my backend server to determine the number of downloads available to the user.
Since the number of downloads of these resources is much higher than the number of uploads, I’m looking for an object cloud storage service with cheap downstream traffic. r2 and wasabi look like a good fit!
I wanted to achieve precise permission control with cloudflare workers, but in reading the documentation for cloudflare workers, I found these limitations:

a. I need to access my backend in cloudflare worker function, which may take 100~500ms or even longer, but the worker can only support 6 concurrent outgoing connections at the same time, does it mean that if 10 users click on the download button at the same time, the extra users need to queue up and wait for my backend to determine the permission?

b. The maximum execution time of worker is 30s, if a resource is too big and the download can’t be finished in 30s, will the worker terminate the download?

Each request gets its own Worker invocation, it’s 6 concurrent connections per invocation :slight_smile: So no problem.

That time shouldn’t include the time to download, as far as I know. You might want to run some tests, just to confirm, by throttling the speed of the download on the browser, maybe.

Someone else might also confirm if this is as I’m pretty sure it is, and be fine.