sse-starlette 3.7.0 wire format: cache-control no-store and x-accel-buffering no headers, id/event/data lines per dict, and pings as comment lines `: ping - <UTC timestamp>` every N seconds
Captured 2026-11-15 with FastAPI 0.162.7 / uvicorn 0.54.0 / sse-starlette 3.7.0 using curl -N. Response headers: cache-control: no-store, connection: keep-alive, x-accel-buffering: no (disables nginx buffering), content-type: text/event-stream; charset=utf-8, chunked. Yielding {"id": "1", "event": "message", "data": ...} produces id: 1, event: message, data: ... and a blank line; omitting event produces no event line (the browser still dispatches onmessage). EventSourceResponse(gen, ping=1) emits : ping - 2026-11-15 01:50:21.744569+00:00 as an SSE comment at that interval, which browsers ignore and which keeps proxies from idling the connection; your own line-based parser (curl, Python) must skip lines starting with a colon or it will try to JSON-parse the ping. The request header Last-Event-ID is not interpreted by sse-starlette; read it yourself to resume.