3 ms·
SSE is plain HTTP, and might be illustrative to look[1] at the HTTP response directly so that you can convince yourself of this. EventSource is simply an imple
by geocar 11y ago
SSE is plain HTTP, and might be illustrative to look[1] at the HTTP response directly so that you can convince yourself of this.
EventSource is simply an implementation of a parser of those messages.
The problem is that MSIE and Chrome often delay dispatching content-received (XMLHttpRequest readyState=3) handlers until a certain number of bytes have been received (or in certain other circumstances, such as in Chrome's native implementation of EventSource). The bytes-received is solved by simply starting with some padding, and unless you need framing you might find it simpler to just use XMLHttpRequest directly.
[1]: http://www.html5rocks.com/en/tutorials/eventsource/basics/ http://www.html5rocks.com/en/tutorials/eventsource/basics/