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

    Crazy Rabbit

    04/01/2023, 5:24 PM
    and when checking if banner is inside cache, I will also be able to get the content type.
  • c

    Crazy Rabbit

    04/01/2023, 5:25 PM
    But how do I get the content type from R2?
  • c

    Crazy Rabbit

    04/01/2023, 5:26 PM
    So I can provide it back to setCacheR2 function and also return it back with headers
  • c

    Crazy Rabbit

    04/01/2023, 5:48 PM
    Probably
    httpMetadata.contentType
    ?
  • c

    Crazy Rabbit

    04/01/2023, 5:54 PM
    Strange it works in first try. This makes it even more suspicious.
  • a

    Aiden

    04/01/2023, 7:16 PM
    Is there any plans to have R2 support some kind of automatic deletion/retention? Can definitely build it myself in the meantime, just wondering if R2 is planning to bring some native solution I'm basically thinking of some way to set
    "Retention":<Either some kind of timestamp, or maybe seconds till deletion?>
    in the put object API
  • h

    HardAtWork

    04/01/2023, 7:19 PM
    Like the Lifecycle API?
  • a

    Aiden

    04/01/2023, 7:21 PM
    ...did I miss an API when reading cf docs?
  • a

    Aiden

    04/01/2023, 7:21 PM
    Unless you mean S3's one? I didn't see it supported though (but yes, s3's lifecycle api would be a fine alternative to this!)
  • a

    Aiden

    04/01/2023, 7:23 PM
    my current plan is to put the unix timestamp when uploaded in the object name, then have a cron worker just ListObjects where the beginning of the timestamp indicates all objects in that range are likely to be old, paginate through, double check
    uploaded
    time on the object, then delete them
  • a

    Aiden

    04/01/2023, 7:24 PM
    im basically going to be producing/uploading some temporary content that gets replaced with a new unique object every 10 minutes or so, ill keep deleting the old object when uploading the new, but would like to have some fallback scanning to keep things clean
  • h

    HardAtWork

    04/01/2023, 7:26 PM
    https://developers.cloudflare.com/r2/buckets/object-lifecycles/
  • a

    Aiden

    04/01/2023, 7:27 PM
    omg this is perfect, i cant believe i missed this when going through the docs (and exactly what i'm looking for)
  • a

    Aiden

    04/01/2023, 7:27 PM
    ty
  • u

    Unsmart | Tech debt

    04/01/2023, 7:36 PM
    interesting TIL that was actually in beta finally
  • s

    Skye

    04/01/2023, 7:52 PM
    Released ~2 weeks ago, see the 2nd pin 🙂
  • k

    Kinuseka

    04/01/2023, 7:54 PM
    Hi may I ask after surpassing the first free 1 million Class A requests, am I immediately billed 4.5 usd after the first request beyond the free tier limit?
  • e

    Erisa | Support Engineer

    04/01/2023, 8:10 PM
    You're not, its divided based on how many you actually did
  • e

    Erisa | Support Engineer

    04/01/2023, 8:10 PM
    4.50 / 1 million puts it at $0.0000045 for each additional Class A request, but that doesnt have quite the same ring to it
  • k

    Kinuseka

    04/01/2023, 8:14 PM
    that's reassuring to see, thanks for the response.
  • f

    Fascinated

    04/02/2023, 12:02 AM
    Is it possible to change the unknown object page without using a CF worker?
  • c

    Chaika

    04/02/2023, 12:04 AM
    To show index.html or something else? Sure, you can use transform rewrite url rules. These change the url path to the origin, so the visitor would still see the path unchanged
  • f

    Fascinated

    04/02/2023, 12:05 AM
    sweet, thanks :)
  • c

    Chaika

    04/02/2023, 12:05 AM
    You can find Transform Rules under your website/zone in the Cloudflare dash, then Rules -> Transform Rules -> Rewrite URL. Then, "Create Rule". Here's a magic link to go straight to creating a new one: https://dash.cloudflare.com/?to=/:account/:zone/rules/transform-rules/rewrite-url/new Your rule should look something like this:
  • f

    Fascinated

    04/02/2023, 12:05 AM
    oo okie tyty
  • a

    aeharding

    04/02/2023, 12:29 AM
    Another r2 user running up against the bug of not respecting range requests over 500mb 😦 https://github.com/Chocobozzz/PeerTube/issues/5724
  • a

    aeharding

    04/02/2023, 12:29 AM
    (it looks like they also have a CORS misconfiguration preventing the video from playing atm)
  • v

    valkyrie_pilot

    04/02/2023, 2:18 AM
    for R2, is there a way to make some file a "pointer" to another file? I have a script which creates a new file once per day, and right now i just have two copies of it 😅 (please ping in reply)
  • k

    Kinuseka

    04/02/2023, 2:58 AM
    It seems unfortunate that despite r2 is almost now a year released to public there are still major bugs that deter me from using them. This seems like a critical bug and breaks the functionality as a storage service. I believe this should be up the priority to fix.
  • u

    Unsmart | Tech debt

    04/02/2023, 3:41 AM
    Other than the range requests for files over 500mb what are other major bugs? Thats really the only one I know of that isnt fixed. And that doesnt fall on the R2 team so they cant do anything to fix it unfortunately would need the cache team to look at it
1...972973974...1050Latest