Search code examples
jqueryhtmlasynchronousserver-sent-events

jQuery and AJAX or server sent events


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?


Solution

  • 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.