Take the 2-minute tour ×

It seems in both cases client sends a request to server and server answers, unless in server sent event you can set retry time in your server side code. So is there any benefit in using SSE rather than jQuery post or get method?

share|improve this question
What server language/framework are you using? –  StuperUser Oct 12 '11 at 12:00
Could you provide an example of the code and the responses? –  David Laberge Oct 12 '11 at 12:04
add comment

2 Answers

up vote 6 down vote accepted

SSE is not supported by IE but you can make it work with IE 8+ if you use a library.

Server sent events create less traffic on the server. The client does not need to ask for news every minute. Data is only delivered when it is available. Also the data arrives instantly at the client not only when the client ask for it.

If you like to use SSE you should use a library like Yaffle's EventSource.

share|improve this answer
github.com/Yaffle/EventSource - javascript polyfill - streaming supported in all browsers (IE8+) –  4esn0k Nov 29 '11 at 4:24
add comment

Using SSE is better because the request weight is far less than long polling. In long polling you need to issue a HTTP request each time but in SSE, you just need to use one HTTP connection for sending data from the server to the client.

Implanting SSE in server is easy to do (especially in node.js).

Here is a PHP library for handling SSE and it's created by me.

Hope these things can help you.

share|improve this answer
add comment

Your Answer


