Server-Sent Events
Server-Sent Events (SSE) is a web standard that lets a server push a continuous stream of text-based updates to a client over a single, long-lived HTTP connection, using a simple event-stream format the browser parses natively.
Definition
Server-Sent Events (SSE) is a web standard that lets a server push a continuous stream of text-based updates to a client over a single, long-lived HTTP connection, using a simple event-stream format the browser parses natively.
Overview
SSE solves a narrower version of the problem WebSockets solve: when a client only needs to receive updates from the server — not send them back over the same channel — SSE offers a much simpler mechanism built directly on HTTP. A client opens a connection to an endpoint using the browser's `EventSource` API, and the server keeps that connection open, writing a stream of `data:`-prefixed text events that the browser automatically parses and delivers as JavaScript events, complete with built-in reconnection if the connection drops. Because SSE is just HTTP, it works transparently with existing infrastructure — proxies, load balancers, and CDNs that understand HTTP generally don't need special configuration the way WebSocket upgrades sometimes do, and requests can be authenticated with normal HTTP headers or cookies. This makes SSE a popular choice for use cases like streaming AI model output token-by-token, live news or score updates, progress bars for long-running jobs, and notification feeds — anywhere data flows mostly in one direction, from server to client. The tradeoff is that SSE is one-way and text-only by default (binary data must be encoded), and browsers cap the number of concurrent SSE connections per domain over HTTP/1.1, though HTTP/2 multiplexing largely removes that limit. When an application genuinely needs the client to push data back over the same low-latency channel, WebSockets remain the better fit. It is often mentioned alongside REST API in this space.
Specification
- One-way streaming from server to client over plain HTTP
- Native browser support via the EventSource API
- Built-in automatic reconnection on dropped connections
- Works transparently with most existing HTTP infrastructure
- Simple text-based event-stream format
- No special protocol upgrade or handshake required
Use Cases
History
Server-Sent Events (SSE) is a browser standard for one-way, server-to-client streaming over a single long-lived HTTP connection, consumed through the JavaScript EventSource API. Unlike WebSockets, SSE is unidirectional and text-based, automatically reconnects, and supports event IDs and named event types — a good fit for live feeds such as notifications, stock tickers, and streaming AI responses. The technique was first implemented experimentally in the Opera browser in 2006 under the name "Server-Sent Events." After years of iteration it was published by the W3C as a Recommendation on February 3, 2015, and it is now maintained as part of the WHATWG HTML Living Standard.
Sources
- WHATWG HTML Living Standard — Server-sent events · as of 2026-07-17
- MDN Web Docs — Using server-sent events · as of 2026-07-17
Frequently Asked Questions
From the Blog
Client-Server Architecture Explained Simply
Client-server architecture is a model where client applications request services and server applications provide them over a network. This guide breaks down how requests, responses, and communication protocols fit together in practice.
Read More AI & TechnologyHow to Build an MCP Server for Your Internal Tools
Building an MCP server means wrapping internal APIs as named tools with strict input schemas, explicit auth boundaries and error messages a model can act on. This covers choosing what to expose, writing schemas that prevent bad calls, handling credentials, shaping responses for context budgets and testing before an agent touches production.
Read More ProgrammingManaging server state in React: caching, refetching and staleness
Fetched data is a cache of something you do not own, and storing it in ordinary component state is what produces duplicate requests, stale views and out-of-order responses. This covers the behaviours that cache needs — deduplication, staleness, invalidation, race handling — and what you take on by hand-rolling them.
Read More ProgrammingJavaScript for Beginners: The Ultimate 2026 Guide
JavaScript makes web pages interactive — master the core language that runs on every browser and server.
Read More