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

    kian

    04/17/2023, 6:13 PM
    Shouldn’t be an issue as the headers are separate to the body so the body stream can still be sent as-is
  • k

    kian

    04/17/2023, 6:13 PM
    But that’s just a guess
  • k

    Kaelten

    04/17/2023, 6:16 PM
    I guess I'd know if the await takes a moment versus 30s or something
  • s

    simons

    04/17/2023, 6:25 PM
    Does Walker support 24-hour socket communication? What is the cost of socket communication 24/7 for 30 days?
  • h

    HardAtWork

    04/17/2023, 6:25 PM
    WebSockets, yes. Raw Sockets, no.
  • s

    simons

    04/17/2023, 6:35 PM
    @HardAtWork Thank you! 24/7 for 30 days can use websocket, is it right?
  • h

    HardAtWork

    04/17/2023, 6:36 PM
    Yes, though you aren't guaranteed that it will stay alive that long, so you may need a Durable Object Alarm to keep the connection alive.
  • s

    simons

    04/17/2023, 6:38 PM
    Thanks for the good information.👍👍
  • k

    Kevin W - Itty

    04/17/2023, 7:20 PM
    This is great, and certainly got me started - but is there any sort of comprehensive docs on this API? I'm trying to find the KV/R2/DO operations per-Worker, for instance, but can't seem to find just a full API guide of what's even available to query (and how)
  • k

    kian

    04/17/2023, 7:25 PM
    https://cfdata.lol/graphql/
  • u

    Unsmart | Tech debt

    04/17/2023, 7:27 PM
    Don't think theres any way to get specific number of requests to KV/R2/DO from which script (DO might, but I assume its scriptName dimension is always the script it is uploaded to). The only thing you really can get is how many subrequests a script has done with
    workersSubrequestsAdaptiveGroups
    . And yeah dont think they really do any docs besides the standard graphql docs
  • m

    Mozzy

    04/17/2023, 8:05 PM
    Let's say I have ~60 images (~250-600 KB) that will never change. I'm currently storing these as base64 in KV like in the 1st image and then convert the b64 to a blob before returning the image. Disgusting, but works. An alternative is to store these as actual image files in R2 (image 2) and just return
    await <R2ObjectBody>.blob()
    What would generally give me the best speed here?
  • j

    James

    04/17/2023, 8:09 PM
    I'd probably store them in KV like you have, but maybe not base64, and maybe as the raw binary so I could pull them as a
    ReadableStream
  • Hello guys can someone kindly help me
    f

    fenospro

    04/17/2023, 8:11 PM
    Hello guys, can someone kindly help me figuring out why CF workers seems to buffer the request before sending it to my origin server? I'm trying to upload a large file to a worker and the worker proxy the request to my origin server. However it seems that the worker is not sending any data to my origin until all the body is received Is there something i need to disable? any help would be hugely appreciated - I've spent the past week debugging this with no luck
    j
    • 2
    • 10
  • j

    James

    04/17/2023, 8:11 PM
    If they're never gonna change, KV with a very high
    cacheTTL
    is likely going to be the most performant, especially if they're just `ReadableStream`s you can return to the response without any kind of conversion
  • m

    Mozzy

    04/17/2023, 8:13 PM
    I currently do
    { cacheTtl: 604_800 }
    with storing them as b64
  • j

    James

    04/17/2023, 8:14 PM
    Outside of changing how they're stored so you don't have to do any base64 conversion, that's probably the fastest way you could do this. How big are the images? The performance differencee we're talking here is probably marginal. You could even throw in the
    cache
    API directly to cache the
    Response
    after you create it.
  • m

    Mozzy

    04/17/2023, 8:16 PM
    They're 250-600 KB in size. I have absolutely no complaints about current performance, R2 just seemed like a cool thing to look into
  • m

    Mozzy

    04/17/2023, 8:17 PM
    (also not dealing with converting images to something other than an image file)
  • j

    James

    04/17/2023, 8:18 PM
    Yeah at that size my suggestion would be a marginal difference. R2 is very cool! But for something like this, I'd personally stick with KV
  • m

    Mozzy

    04/17/2023, 8:18 PM
    The Worker in question btw:
  • m

    Mozzy

    04/17/2023, 8:21 PM
    I'll keep it as is for now. Thanks :)
  • d

    dave

    04/18/2023, 1:39 AM
    Is there a way to shut down a local worker after it's running for x amount of seconds or handles a one request?
  • d

    dave

    04/18/2023, 1:39 AM
    trying to run a Worker in a CI/CD pipeline
  • a

    avi

    04/18/2023, 3:49 AM
    not a Workers expert, but i'd just kill the worker or have it call process.exit() or something
  • h

    HardAtWork

    04/18/2023, 6:19 AM
    You would probably have to kill the connection to do that
  • s

    Stu

    04/18/2023, 11:01 AM
    Hi all, I'm trying to use workers to proxy requests to two different Wordpress websites based on the path. I need to forward any form data for the login but wordpress is complaining that the username/password is empty. I'm forwarding the request using var response = await fetch(baseURL + path, request); but I get the error "Response body object should not be disturbed or locked". Anyone any ideas?
  • s

    simons

    04/18/2023, 12:24 PM
    I want to disconnect the connecting client How to do it inside worker I'm trying to use it to prevent duplicate logins Login with another IP -> Disconnect the existing login websocket
  • h

    HardAtWork

    04/18/2023, 12:32 PM
    websocket.close()?
  • s

    simons

    04/18/2023, 12:41 PM
    yes i also think so but how do i specify a client using websocketpair??
1...240224032404...2509Latest