https://discord.cloudflare.com logo
Join Discord
Powered by
# workers-discussions
  • d

    dkfdkdodkms

    05/02/2023, 8:16 PM
    any idea if this will work? this.state.storage.delete(this.state.id.toString()); (from within a durable object)
  • h

    HardAtWork

    05/02/2023, 9:24 PM
    It would delete something in DO storage that matches the current ID of the DO, if that is what you mean?
  • d

    dkfdkdodkms

    05/02/2023, 9:25 PM
    yes
  • d

    dkfdkdodkms

    05/02/2023, 9:26 PM
    thanks
  • h

    HardAtWork

    05/02/2023, 9:26 PM
    It won’t delete the DO itself though, if that is what you mean
  • d

    dkfdkdodkms

    05/02/2023, 9:27 PM
    i mean the storage (i think)
  • h

    HardAtWork

    05/02/2023, 9:29 PM
    It will only delete a single item
  • k

    kian

    05/03/2023, 12:16 AM
    router.all('*', () => new Response('Not Found', { status: 404 }))
  • k

    kian

    05/03/2023, 12:16 AM
    You're currently only listening on
    /
    so anything else will just receive an error page
  • f

    fidozo

    05/03/2023, 10:27 AM
    Hi, is SIMD available on workers through WASM?
  • c

    Crazy Rabbit

    05/03/2023, 11:40 AM
    I probably shouldn't generate RSA keys in Cloudflare Worker right?
  • c

    Crazy Rabbit

    05/03/2023, 11:41 AM
    I should generate it on clients device and then send it to the worker
  • s

    SebastiaanYN

    05/03/2023, 12:15 PM
    in most cases you'd probably want to keep the keys in the same place they were generated
  • s

    SebastiaanYN

    05/03/2023, 12:15 PM
    not sure why you'd want the client and server to both know the keys
  • c

    comagoosie

    05/03/2023, 12:51 PM
    Yeah when I tested this SIMD was available.
  • c

    comagoosie

    05/03/2023, 1:21 PM
    If worker sites are deprecated, am I "stuck" on worker sites as long as I need
    /api
    requests to passthrough and hit an origin server? 99% requests are static assets so cloudflare pages look enticing
  • j

    James

    05/03/2023, 1:24 PM
    You can use Functions with Pages to accomplish the same thing 😀
  • j

    James

    05/03/2023, 1:25 PM
    A Function in
    /api/[[path]].ts
    for example
  • c

    comagoosie

    05/03/2023, 1:26 PM
    What is the syntax for passing through to the origin server? A naked
    return;
    without a response that works in Worker sites doesn't work in functions (at least locally)
  • j

    James

    05/03/2023, 1:26 PM
    You’d need to
    fetch
    the api manually. So something like
    return fetch(url);
  • j

    James

    05/03/2023, 1:27 PM
    Where
    url
    is something you construct from the path +
    api.example.com
    for example
  • c

    comagoosie

    05/03/2023, 1:28 PM
    Ah, so you're suggesting moving api requests to another domain?
  • k

    kian

    05/03/2023, 1:29 PM
    You'd have to because Pages custom domains have Pages as the origin
  • k

    kian

    05/03/2023, 1:29 PM
    You can't overlay it as a Worker route
  • c

    comagoosie

    05/03/2023, 1:30 PM
    Gotcha, and what is the best way to ensure that only requests from this pages function can hit the origin server?
  • c

    comagoosie

    05/03/2023, 1:30 PM
    Like just throw up some basic auth? Or something else?
  • t

    Tom Sherman

    05/03/2023, 1:31 PM
    what is the origin server? if it's another worker you can add a service binding which won't even go over the internet and doesn't need any auth
  • c

    comagoosie

    05/03/2023, 1:34 PM
    It's a service on a VPS that cloudflare worker sites currently passes requests to if an
    /api
    route is detected. It's behind traefik, so adding a custom domain + basic auth shouldn't be too hard. Eventually I'd like to move all the api routes into cloudflare pages functions, but I'd like to transition one endpoint at a time
  • b

    bret_pat

    05/03/2023, 1:37 PM
    It seems like parsing a 1MB json blob exceeds the 50ms compute limit. There isn't a faster or cloudflare worker specific way of parsing JSON responses that is faster right?
  • t

    Tom Sherman

    05/03/2023, 1:43 PM
    i'm sure i've parsed JSON way bigger than 1MB before 🤔 can you share an example?
1...243124322433...2509Latest