# Server-Sent Events Resources

## Knowledge

- [Spec: HTML Living Standard — Server-sent events (WHATWG)](https://html.spec.whatwg.org/multipage/server-sent-events.html)
  Normative source for `EventSource`, stream format (`data:`, `id:`, `event:`, `retry:`), reconnection, `Last-Event-ID`, and authoring notes (proxies, connection limits). Use for: any claim about how the protocol actually works.
- [MDN: Server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events)
  Browser-facing overview and API map. Use for: orientation before diving into the spec.
- [MDN: Using server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events)
  Practical client/server field reference and reconnection behavior. Use for: implementation details and field meanings.
- [MDN: EventSource](https://developer.mozilla.org/en-US/docs/Web/API/EventSource)
  Interface reference (`readyState`, `withCredentials`, events, `close()`). Use for: API surface while coding.
- [web.dev: Stream updates with server-sent events](https://web.dev/articles/eventsource-basics)
  Clear FE-oriented comparison to polling, long-polling, and WebSockets; client examples. Use for: first mental model and when-to-choose framing.
- [javascript.info: Server Sent Events](https://javascript.info/server-sent-events)
  Concise tutorial with reconnection/`Last-Event-ID` emphasis. Use for: compact second pass after web.dev.

## Wisdom (Communities)

- [Stack Overflow — [server-sent-events]](https://stackoverflow.com/questions/tagged/server-sent-events)
  High volume of real proxy, buffering, and reconnect edge cases. Use for: debugging production-ish failure modes.
- [r/webdev](https://www.reddit.com/r/webdev/) and [r/ExperiencedDevs](https://www.reddit.com/r/ExperiencedDevs/)
  Design-tradeoff discussions (SSE vs WebSocket vs polling) in product context. Use for: second opinions on architecture choices — treat answers as anecdotes, verify against the spec.

- [text/plain: The Pitfalls of EventSource over HTTP/1.1 — Eric Lawrence](https://textslashplain.com/2019/12/04/the-pitfalls-of-eventsource-over-http-1-1/)
  Browser HTTP/1.1 ~6 connections/host starves other requests when many tabs hold SSE. Use for: connection-limit design reviews; HTTP/2 as mitigation.
- [WHATWG HTML issue #2177 — Setting headers for EventSource](https://github.com/whatwg/html/issues/2177)
  Spec authors’ stance: custom headers intentionally absent; build on `fetch()` if needed. Use for: auth-header design decisions.
- [nginx / proxy buffering for SSE](https://serverfault.com/questions/801628/for-server-sent-events-sse-what-nginx-proxy-configuration-is-appropriate)
  Practical `proxy_buffering` / `X-Accel-Buffering: no` guidance. Use for: “events arrive in batches or never” debugging.

## Gaps

- No single canonical “SSE at scale” design book; connection fan-out and multi-instance backends are mostly scattered blog/ops writeups. Validate any scaling advice against your stack’s connection model.
