Re:Server-Sent Events (SSE) Are Underrated
by sudhirj on Thursday December 26, 2024 @11:42AM
(#42516148)
Not entirely. If a load balancer is set to buffer say 4kb of data all the time, your SSE is stuck until you close the connection.
I think there is a HTTP/2 flush instruction, but no load balancer is obligated to handle it and your SSE library might not be flushing anyway.
Re:Server-Sent Events (SSE) Are Underrated
by deaf_coder on Thursday December 26, 2024 @12:03PM
(#42516291)
In my case with this load balancer, I think it's just badly written. I think it is set to hold ALL data until the server ends the connection. I have tried leaving my SSE open to send over a few megabytes worth of data and the load balancer never forwarded it at all until I commanded the server to close the connection.
The dev who wrote that code probably didn't think too much about memory efficiency of proxying HTTP connections or case of streaming HTTP connections like SSE.
Usually things would just get streamed through but for some reason until the full header was sent the proxy didn't forward and didn't acknowledge the connection.
Not saying that is your issue but definitely was mine.