Many web apps nowadays, including project I’m working on, rely on real time notifications from the server. GMail instantaneously adds incoming mail, Facebook shows chat messages and likes, list can go on.
My app does the same: it subscribes to certain topics and keeps open channel for server updates. Traditionally, we’ve been using long polling for that, but it felt like a hack, so we decided to switch to web sockets and fall back to long polling for legacy browsers. It took me 2 years to get to Ilya Grigorik’s «High Performance Browser Networking» book and realise that Server-Sent Events was much better choice. Here’s why. Читать далее When Server-Sent Events (SSE) is much better choice than WebSocket