Reference

SSE glossary

Shared vocabulary for this workspace. Lessons stick to these meanings.

Server-Sent Events (SSE)
A browser-standard way for a server to push a stream of text events to a client over a long-lived HTTP response of type text/event-stream. Client API: EventSource.
EventSource
The browser interface that opens an SSE connection, dispatches open / message / named events / error, auto-reconnects, and exposes readyState and close().
Event stream
The UTF-8 text protocol of fields (data:, event:, id:, retry:) separated by blank lines. Defined in the HTML Living Standard.
Unidirectional (server → client)
Only the server sends event payloads on the SSE connection. The client still uses normal HTTP (or other APIs) for commands.
Short polling
Client repeatedly requests “any updates?” on a timer. Simple, wasteful when quiet, laggy when interval is large.
Long polling
Client opens a request; server holds it until data (or timeout), then client immediately opens another. Better than short polling; more request churn than SSE.
WebSocket
Full-duplex socket after HTTP upgrade. Both sides send messages freely (text or binary). Different protocol and ops surface than SSE.
Last-Event-ID
On reconnect, the browser may send the last seen event id in the Last-Event-ID request header so the server can resume. Resume is only as good as server support.
Automatic reconnection
Built into EventSource: after a drop (non-fatal), the UA waits (default ~few seconds; tunable via retry:) and reconnects. Fatal failures or close() stop retrying.
withCredentials
EventSource init option to include cookies/credentials on cross-origin requests. Does not let you set arbitrary headers (e.g. custom Authorization).