010. HTML5 Server Sent Events
Conventional web applications generate events which are dispatched to the web server. For example a simple click on a link requests a new page from the server. The type of events which are flowing from web browser to the web server may be called client-sent events. Along with HTML5, WHATWG Web Applications 1.0 introduces events which flow from web server to the web browsers and they are called Server-Sent Events (SSE). Using SSE you can push DOM events continously from your web server to the visitor's browser. The event streaming approach opens a persistent connection to the server, sending data to the client when new information is available, eliminating the need for continuous polling. Server-sent events standardizes how we stream data from the server to the client. Web Application for SSE: To use Server-Sent Events in a web application, you would need to add an <eventsource> element to the document. The src attribute of <eventsource> element should...