🎁 New User? Get 20% off your first purchase with code NEWUSER20 Register Now →
Menu

Categories

Web Development Intermediate

What is Server-Sent Events?

A server push technology that enables a server to send real-time updates to a browser over a single HTTP connection.

SSE provides a simple, unidirectional channel from server to client. The server sends events as text/event-stream content type. The browser uses EventSource API: const source = new EventSource('/events'); source.onmessage = e => console.log(e.data).

SSE is simpler than WebSockets for one-way communication (notifications, live feeds, stock tickers). It supports automatic reconnection, event IDs for resume, and named events. SSE uses standard HTTP, working through firewalls and proxies without special configuration.

Related Terms

Lazy Loading
A technique that delays loading non-critical resources until they are needed, improving initial page load performance.
API (Application Programming Interface)
A set of rules and protocols that allows different software applications to communicate and exchange data.
Cross-Origin Resource Sharing (CORS)
An HTTP mechanism that allows web pages to request resources from a different domain than the one serving the page.
JSON Schema
A vocabulary for validating the structure and content of JSON data, ensuring API requests and responses conform to expected formats.
DOM (Document Object Model)
A programming interface for HTML documents that represents the page structure as a tree of objects that can be manipulated with JavaScript.
HTTP Status Codes
Standardized three-digit codes returned by web servers to indicate the result of a client's HTTP request.
View All Web Development Terms →