Disable request buffering

I would like to disable request buffering, I have spoke on discord and filed an issue. My problem as explained is Cloudflare is buffering my request, I have a long running request that I wish to read in chunks as they arrive using a BYOB stream reader, it seems to only work if the client signals an end of stream, at that moment Cloudflare starts processing my request.

I was advised that I should disable request buffering.

The discord public chat thread is here Discord

This is Workers, right? Can you edit the title of your post (category, actually) so it’s in Developers → Workers? That should get more attention. @matteo does quite a bit in Workers, as does @thomas4.

1 Like

I believe this was solved with a page rule that forced no cache.

2 Likes

anyway to test this pagerule or know what it is?

Yes, Cache Level: Bypass

1 Like

I haven’t tested Websockets at all yet and streaming chunks of data is still very much undocumented. There’s just handful of posts here on the forum too. Sorry I can’t be of much help until I have time to work on it.

1 Like

Okay np, thanks for looking at it regardless, also the websockets are not part of the equation, they work fine i think because I testing with fetching to another DO (instead of echoing to websockets) and the same blocking occurs.

The problematic part is chunk encoding / body streaming.

I’ll let you know if I ever get assigned to streaming, I know it’s on our roadmap (where I work).

1 Like

I’m not trying be rush here, but any update on this? I saw Cloudflare also support http2 to origin, but seems Cloudflare buffer request too.

We switched from CF workers to Deno, but you can use the native ReadableStream - Web APIs | MDN API on both, which I recommend.

but seems worker only sent request body into code when http body is finished in client side. Can’t
bidirectional streaming. But deno deploy is fine for bidirectional streaming.

A post was split to a new topic: Request buffering causign delays