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

    stegod10

    03/09/2023, 10:33 AM
    I want to do everything programatically. I will create 30 bucket per day. I can't to it that way.
  • s

    stegod10

    03/09/2023, 10:34 AM
    How to add custom domain to a bucket programatically? @HardAtWork
  • s

    Skye

    03/09/2023, 10:39 AM
    The API isn't exposed at the moment
  • s

    stegod10

    03/09/2023, 10:41 AM
    we need that
  • s

    Sid | R2

    03/09/2023, 11:24 AM
    Indefinitely! Cursors do not have a timestamp attached to them. This does mean of course that if you add an object in the mean time that would have been listed before this cursor, it won’t ever be listed since listing only goes forward, if that makes sense.
  • a

    Advany

    03/09/2023, 12:17 PM
    I want to prerender pages and offer them to bots. I already figured out how to prerender but I was wondering, what would be the best way to cache them and send them? I handle the responses using workers. Is it best practice to store it in the cache (for up to a month) and then serve it? or is it better to utilize r2? what would be faster to lookup and serve the request?
  • a

    Advany

    03/09/2023, 12:19 PM
    I know how to build a cache key using new Request and build a response to cache using new Reponse.
  • e

    Epailes

    03/09/2023, 12:21 PM
    Depends on how costly it is for you to render the page, if any data is being retrieved from external API, how "fast" do you need the response to be? There's no guarantee how long content will stay in cache for, so don't rely on it being there for a month. The best approach is likely storing the page in R2, but when a request comes in check cache first, if it's not present retrieve it from R2 and store in the cache to reduce costs of future requests (until its evicted from cache) However if you really care about fast response times you might want to look into storing the result in KV (although it costs more than R2).
  • a

    Advany

    03/09/2023, 12:23 PM
    I don't really care about costs because the costs of Cloudflare are already so low! Ill look at the KV option. Didnt think of that!
  • e

    Erisa | Support Engineer

    03/09/2023, 1:05 PM
    I think you may have missed putting a reply on this 😛 cc @Jacob | Pages
  • c

    Cyb3r-Jok3

    03/09/2023, 1:53 PM
    You can probably copy the api call that the dashboard makes and mimic it in your code. Not stable or supported but it should work
  • j

    Jacob | Pages

    03/09/2023, 2:17 PM
    Perfect, thanks! That’s actually perfect because I only need to process objects up until a certain date anyway 🙂
  • a

    Adraas

    03/09/2023, 2:29 PM
    There seems to be some issue with multipart uploads? I have got a couple of multipart uploads that on DELETE, change their upload ID instead of being deleted.
  • k

    kian

    03/09/2023, 2:30 PM
    Everytime you run ListMultipartUploads, the ID will change anyways
  • k

    kian

    03/09/2023, 2:30 PM
    Maybe that's what you're experiencing rather than the
    DELETE
    causing it
  • a

    Adraas

    03/09/2023, 2:30 PM
    Wait what how have I missed this
  • a

    Adraas

    03/09/2023, 2:30 PM
    Thanks kian
  • a

    Adraas

    03/09/2023, 2:31 PM
    Do you know why that happens? Security reasons?
  • k

    kian

    03/09/2023, 2:31 PM
    There's an open issue to fix it, the encryption of that ID just isn't deterministic right now.
  • k

    kian

    03/09/2023, 2:31 PM
    https://discord.com/channels/595317990191398933/940663374377783388/1020418300162875462
  • a

    Adraas

    03/09/2023, 2:35 PM
    Right thanks
  • s

    silentdevnull

    03/09/2023, 4:24 PM
    Did you have any ideas on the topic or just was wondering what I was thinking.
  • f

    Fleetwood

    03/09/2023, 4:57 PM
    When using the
    .dev
    domain, you can simply make a get to
    r2.dev/{bucket}/{fname}
    and you're away. With a custom domain this seems not to be the case.
  • k

    kian

    03/09/2023, 4:57 PM
    r2.dev shouldn't include the bucket name
  • k

    kian

    03/09/2023, 4:57 PM
    The URLs are specific to a bucket already
  • f

    Fleetwood

    03/09/2023, 4:57 PM
    Sorry, yes.
    r2.dev/{fname}
    for example
  • f

    Fleetwood

    03/09/2023, 4:57 PM
    Now i've switched to a custom domain, do I need to go via the S3 API?
  • f

    Fleetwood

    03/09/2023, 5:02 PM
    FYI: worked exactly the same, just took longer than expected to go live. It said Active on the page but wasn't actually accessible
  • j

    Jon @ Transistor

    03/09/2023, 7:16 PM
    hello all. Attempting to switch from S3 to R2 presigned URLs for direct uploads using Dropzone.js. Mostly there, I think, however, the
    preflight
    request is always 403ing. it's an OPTIONS type request, and I'm not entirely sure how to get those working? Browser console is showing
    Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
    I have set up the CORS policy for the bucket with
    "AllowedOrigins": ["*"]
  • k

    kian

    03/09/2023, 7:18 PM
    What Content-Type is the request body?
1...937938939...1050Latest