Server-sent events connection sharing?


Well-Known Member
A question:

(Keepalive is on.)
if I initiate server-sent events (SSE text/event-stream) for 2000 logged clients (every x secs data update per client), does lsws tie 2000 http connections for those (when waiting for data), or can it share existing ones?

I could of course do the server side script "wrong format" and the automatic reconnect of SSE would then close it on error and start a new connection every x secs. This is like AJAX polling every x secs (but simpler), but I think that would re-use http connections, right?


LiteSpeed Staff
If keepalive timeout is longer than x seconds, then the connection belong to one client is more likely reused by that client. the connection cannot be shared among clients.