Ch. 20 · Networking

Server-Sent Events and One-Way Updates

Server-Sent Events and One-Way Updates. Learn the reasoning, a practical example, common mistakes and an interview exercise.

~2 min readadvancedupdated Oct 3, 2026

Server-sent events deliver a server-to-client event stream over HTTP. Reconnection and event identifiers support continuity when used deliberately.

Before you start

You should understand clients, servers, IP addresses and ports. Follow a request through name resolution, connection establishment and application exchange. Distinguish protocol guarantees from deployment policy, and use observations from the relevant layer rather than guessing from one browser error message.

The practical goal is to reason through this situation: A job status page listens for progress and reconnects if the stream drops. Read the walkthrough first, then try the interview exercise before opening its answer. The important part is explaining the decision and its consequences, rather than remembering a definition alone.

Step-by-step walkthrough

Step 1: Define one-way updates

The server emits progress while ordinary HTTP handles commands.

Step 2: Carry event identity

Stable IDs can support deliberate resume behavior.

Step 3: Provide replay or snapshot

The server must retain enough history or offer a fallback.

Worked scenario

A job status page listens for progress and reconnects if the stream drops.

A progress stream drops after event 10. A reconnect can communicate its last event ID, but recovery succeeds only if the server honors it with retained events or a current snapshot. Proxy buffering may delay otherwise correct emissions, so observe actual delivery timing across the deployed path.

Common mistake

Transport reconnection alone does not prove every event was retained or replayed.

Verify the behavior

Test reconnect after retained and expired history and inspect proxy buffering.

Interview exercise

Design resumable status updates.

Answer and reasoning

Publish stable event IDs and define replay retention or snapshot fallback, accounting for proxy buffering.

Continue learning

Compare the scenario with the Networking interview questions and test your understanding with the Networking MCQs. For terminology and implementation details, consult the reference material.

More in Networking

read ✓Networking · mid

Networking: DNS Caching and TTL

Understand positive and negative caching, why changes are not instant, and how TTL trades propagation speed against query load.

~2 min readread →
read ✓Networking · easy

Networking: DNS Record Types

Read and choose DNS records: A and AAAA for addresses, CNAME for aliases, and MX and TXT for mail and verification.

~2 min readread →
read ✓Networking · mid

Networking: HTTP Redirects

Choose between 301, 302, 307 and 308, know which preserve the request method, and avoid caching and loop mistakes.

~2 min readread →
esc