3 ms·
I’m sorry, but when you mention all headers need to be sent, what are you referring to? I have working SSE implementations where I only send out the headers onc
by rcarmo 9y ago
I’m sorry, but when you mention all headers need to be sent, what are you referring to? I have working SSE implementations where I only send out the headers once and then pipe minimal data to the client while the socket is open.
- manigandham 9y agoYou're right, I misspoke. I meant that the "data: " pseudo-header for each SSE message is always included, and repeated for multiple lines (but it's HTTP so can be gzipped). It's also UTF8 encoded and meant for text while websockets can send the exact binary bytes you need and no more. Either way, it doesn't really matter unless it's a latency-sensitive or high-volume service, but I prefer the simplicity of SSE.
- invisible 9y agoYeah, but packets being able to be maximized to the window size of the connection early on (and being able to have more than 6 "parallel" downloads as a result) is great for initial page loads.