Server-Sent Events
also: SSE, EventSource
A web technology that enables a server to push real-time updates to connected clients over a single HTTP connection, allowing one-way communication from server to browser.
Server-Sent Events (SSE) is a standard web API that allows a web server to send automatic updates to a client (typically a web browser) without the client having to repeatedly request data. Unlike polling, where the client continuously asks for new information, SSE maintains an open connection and the server initiates data transmission whenever new information becomes available.
The server sends data as text events formatted as data: message\n\n, and the client's JavaScript listens using the EventSource API. For example, a stock ticker or live notification system can stream price updates or alerts to all connected browsers in real-time using a simple HTTP response stream.
SSE is more efficient than polling for scenarios requiring frequent updates but only one-way communication. It works over standard HTTP and automatically handles connection drops and reconnection. For bidirectional communication, WebSockets are preferred instead.