What are Server-Sent Events (SSEs)? Over the years, the specification has seen significant changes, one of them is the newer and sexier communication protocols such as the WebSocket API. The idea behind SSEs may be familiar: a web application "subscribes" to a stream service of updates generated by a server and, whenever a new event occurs, a notification is sent to the client. But to really understand Server-Sent Events, we need to understand the limitations of its AJAX predecessors, which includes:
- Polling is a traditional technique used by the vast majority of AJAX applications. The basic idea is that the application repeatedly polls a server for data. If you're familiar with the HTTP protocol, you know that fetching data revolves around a request/response format. The client makes a request and waits for the server to respond with data. If none is available, an empty response is returned. So what's the big deal with polling? Extra polling cr