Server-Sent Events
Definition
Server-Sent Events keep an HTTP response with Content-Type: text/event-stream open and write events to it; the browser EventSource API parses them and reconnects on its own.
In practice
SSE suits feeds, notifications, progress updates and streamed LLM output, where data flows mostly from server to client. It is plain HTTP, so it works through proxies and over HTTP/2, and server load follows the rate of updates rather than the rate of polling. On reconnect the client sends Last-Event-ID, and a shared event log lets any server resume from that point.
Messages are text only and one-way; the client still sends data with ordinary requests. Proxies that buffer responses or close idle connections break streams, so disable buffering (for example X-Accel-Buffering: no in Nginx) and send heartbeat comments. Over HTTP/1.1, browsers limit connections per host, which caps how many SSE streams a page can open.
Example
A dashboard receives id: 1042 and data: {"orders": 318} every few seconds; after a drop it reconnects with Last-Event-ID: 1042 and gets events 1043 onwards.