text/*
text/event-stream
The MIME type for Server-Sent Events (SSE) streams.
What is text/event-stream?
text/event-stream is the Content-Type that marks a response as a Server-Sent Events (SSE) stream — a long-lived HTTP response consumed by the browser's EventSource API. In plain terms: the content type text/event-stream tells the browser 'keep this connection open and parse each incoming chunk as an event'. Each event is UTF-8 text made of `data:`, optional `event:`, `id:`, and `retry:` fields, with a blank line separating one event from the next. It is the transport behind live notifications, progress bars, and token-by-token LLM streaming.
Typical usage
Streaming updates from server to client — notifications, live tickers, LLM streaming. The server must also send Cache-Control: no-cache and keep the connection open rather than closing after the first write. To debug a captured stream, paste it into the SSE Stream Parser (/tools/sse-stream-parser) to reassemble the full text, tool calls, and usage.
Common gotchas
SSE responses must not be gzipped by intermediaries or the stream will buffer and arrive all at once. Also disable proxy buffering (X-Accel-Buffering: no on nginx). Unlike WebSockets, SSE is one-way (server → client) and runs over plain HTTP.
HTTP header example
Response header
Content-Type: text/event-stream; charset=utf-8Reference
HTML Living Standard — Server-Sent Events
Frequently asked questions
What is the text/event-stream MIME type?
text/event-stream is the Content-Type that marks a response as a Server-Sent Events (SSE) stream — a long-lived HTTP response consumed by the browser's EventSource API. In plain terms: the content type text/event-stream tells the browser 'keep this connection open and parse each incoming chunk as an event'. Each event is UTF-8 text made of `data:`, optional `event:`, `id:`, and `retry:` fields, with a blank line separating one event from the next. It is the transport behind live notifications, progress bars, and token-by-token LLM streaming.
What file extension does text/event-stream use?
text/event-stream has no single canonical file extension — it is used as a transfer / content type rather than being tied to a specific file name suffix.
How do I set the Content-Type for text/event-stream?
Send the HTTP response header Content-Type: text/event-stream; charset=utf-8. Streaming updates from server to client — notifications, live tickers, LLM streaming. The server must also send Cache-Control: no-cache and keep the connection open rather than closing after the first write. To debug a captured stream, paste it into the SSE Stream Parser (/tools/sse-stream-parser) to reassemble the full text, tool calls, and usage.
Is text/event-stream an official MIME type?
Yes. text/event-stream is officially registered with IANA (HTML Living Standard — Server-Sent Events), so standards-conformant clients recognize it.
What are common mistakes with text/event-stream?
SSE responses must not be gzipped by intermediaries or the stream will buffer and arrive all at once. Also disable proxy buffering (X-Accel-Buffering: no on nginx). Unlike WebSockets, SSE is one-way (server → client) and runs over plain HTTP.