|
|
|
|
|
by vanous
3805 days ago
|
|
Thanks for the links. Any experiences with practical deployment, the compatibility chart [1] shows minimal support for mobile browsers and no support for IE? I have several command line tools that i expose via internal web pages and ended up also using setInterval based polling, rather then server pushed messaging. [1] https://developer.mozilla.org/en-US/docs/Web/API/EventSource... |
|
A better option than repeated requests every X seconds (or X times per second) is long polling (see https://en.wikipedia.org/wiki/Push_technology for brief notes and your preferred search engine for many examples). You can only do this if you control the back-end (so can dictate its API) or the API you are using explicitly supports long polling, of course.
There are a number of libraries out there that try to wrap the different methods into one so you don't have to worry about compatibility, using the more efficient websockets where possible, falling back to long-poll where not, and sometimes other methods in between (integrating a little bit of flash for instance). http://socket.io/ is probably the best know of these.