https://discord.cloudflare.com logo
Join Discord
Powered by
# r2
  • t

    Tino

    04/13/2023, 2:10 PM
    Maybe a CF Worker as API & Cache, i don't think that would be an issue.
  • k

    kian

    04/13/2023, 2:30 PM
    https://discord.com/channels/595317990191398933/940663374377783388/1079063747726950400
  • o

    O Rato

    04/13/2023, 2:35 PM
    Ok, thank you very much. This was not so clear for me on the ToS, I first thought that the content should be served directly from R2
  • m

    Maurice

    04/13/2023, 2:49 PM
    this would apply if im caching the response of my api? but my api is being backed by R2 for the content
  • e

    Erisa | Support Engineer

    04/13/2023, 4:37 PM
    Improving tos wording is being worked on > We are in the process of rewriting our terms of service to better reflect the type of services that our customers deliver on our platform today. We are also committed to explaining to our users in plain language what is permitted under self-service plans. As a developer-first company with transparency as one of its core principles, we know we can do better here. We will follow up with a blog post dedicated to these changes later.
  • u

    Unsmart | Tech debt

    04/13/2023, 5:00 PM
    You mean something like Cloudflare Proxy -> Origin -> R2? You would probably get hit by automatic mitigation that way since the content is going through your origin. And from how I personally (not as a professional lawyer) understand the TOS you wouldn't really be allowed to cache it that way if you include content outside of R2 also. Though if you serve mostly HTML content it is fine given the disproportionate clause meaning you can serve some nonHTML content
  • m

    Maurice

    04/13/2023, 5:05 PM
    all cached content will be from r2 🤔 though passing through our infra for validation purposes
  • h

    HappyCathode

    04/13/2023, 5:20 PM
    I'm also pretty confused with the multiple layers of terms and services. Let's say I want to distribute 100 000 non-html files, ranging from 5MB to 2GB. Mp3, mp4, pdfs, etc. I setup a custom domain with caching pointing to my r2 bucket to prevent the r2.dev rate limits. I upload my files to r2 with presigned multipart uploads. Then, any of my user can download any of my files with presigned URL. What's the pricing model? R2 class A/B rates only? Do I need some 2K$ enterprise plan for non-html content delivered over cache? Is this even allowed? If it is allowed, how will files get cached geographically? If a file gets downloaded 1000 times from Europe, and the r2 bucket is in north America, will the cache service in Europe serve the file?
  • h

    HappyCathode

    04/13/2023, 5:21 PM
    If you do need an Enterprise plan for the custom domain part, is it even accurate to say that r2 has no egress fee?
  • o

    O Rato

    04/13/2023, 5:25 PM
    It's confusing, from what I understood from this message (https://discord.com/channels/595317990191398933/940663374377783388/1079063747726950400) is that if the content is served (directly or not) from R2 is allowed, but I'm not sure. Anyway, I wont be serving content from other services through CF
  • u

    Unsmart | Tech debt

    04/13/2023, 5:25 PM
    If you are using R2 directly to serve your content with a custom domain you can serve anything you want and have cache (though there is a limit on file size for cache I believe it's 512MB for non-enterprise). There are no egress fees and no bandwidth limit.
  • u

    Unsmart | Tech debt

    04/13/2023, 5:27 PM
    The only question really comes when you proxy content through an origin server. What they do when that happens no clue
  • m

    Maurice

    04/13/2023, 5:30 PM
    exactly :T
  • h

    HappyCathode

    04/13/2023, 5:36 PM
    Thanks for the response 🙂 Thinking about it, I guess my next problem will be serving cached content with the cache service, backed by presigned R2 URLs. Presigned requests won't make it to R2 to be validated once the caching service caches objects, but that's another question
  • o

    O Rato

    04/13/2023, 5:38 PM
    Doesn't content retrieved from presigned URL count as A/B operations? 🤔
  • h

    HappyCathode

    04/13/2023, 5:40 PM
    They should, but with cloudflare CDN caching files in front of R2, I'm thinking the CDN will serve cached files without ever checking back with R2
  • h

    HappyCathode

    04/13/2023, 5:41 PM
    And if each user gets their own presigned URL, then I'm afraid the CDN will see each request as a new file, cache nothing and hammer r2
  • h

    HappyCathode

    04/13/2023, 5:41 PM
    Will have to test
  • h

    HappyCathode

    04/13/2023, 5:53 PM
    Welp, according to the doc, custom domains are only for public buckets, no way to serve content from a private bucket with presigned url. I guess the preferred method is using workers to duct tape cloudflare services together
  • e

    Ethernal

    04/13/2023, 6:14 PM
    Hey, is there a way to connect multiple buckets to the same url without using a proxy? (eg,
    img.example.com/<bucket name>
    )
  • o

    O Rato

    04/13/2023, 6:15 PM
    probably using workers
  • u

    Unsmart | Tech debt

    04/13/2023, 6:15 PM
    You would need to proxy with a worker or by some other means
  • e

    Ethernal

    04/13/2023, 6:16 PM
    ah alright, thanks. I'll just give them their own subdomain and proxy it
  • u

    Unsmart | Tech debt

    04/13/2023, 6:16 PM
    Could have 2 custom domains and use a url rewrite which wouldn't cost money 🤷
  • e

    Ethernal

    04/13/2023, 6:18 PM
    My plan for now is to just give them their own subdomain, and then proxy it using nextjs to //, but when accessing it i'll just use the subdomain
  • s

    Sid | R2

    04/13/2023, 8:49 PM
    Presigned URLs don’t care about public/private buckets, it’s just that they only work on the S3-compat hostname (r2.cloudflarestorage.com), because, well, presigned URLs are an S3 thing
  • s

    Sid | R2

    04/13/2023, 8:50 PM
    So you fetch content from R2, get it to your infrastructure, then serve it from there? I can ask someone to clarify terms in this case
  • o

    O Rato

    04/13/2023, 8:55 PM
    Hey Sid, I'm working with @Maurice on this in this project Our idea is to use R2 to store our media content, we don't want the user to have direct access to a public bucket because we would lose control on private media, thats why we want the request to be served from our API, which will also handle some other things. If you want I'd like to clarify it for you on DM
    s
    m
    e
    • 4
    • 14
  • o

    O Rato

    04/13/2023, 8:56 PM
    Cloudflare wouldn't cache r2 directly, but would cache the response from our api
  • o

    O Rato

    04/13/2023, 8:56 PM
    thats where we are not sure about violating TOS
1...990991992...1050Latest