chunked transfer encoding
An HTTP/1.1 way of sending a body of unknown length as a series of pieces, each preceded by its size, ending with an empty piece.
In more detail
It lets a server start streaming a response before it knows how big it will be. HTTP/2 and HTTP/3 do not use it because their framing already marks where a body ends.
Example
Node.js uses it automatically when you write a body without setting Content-Length.Related terms
- streaming SSR — Server-side rendering that sends the HTML shell immediately and streams the rest of the page as each piece of data becomes ready.
- HTTP — The protocol web browsers and web servers use to send requests and responses.
- HTTP header — A named line of metadata in an HTTP message, such as Content-Type: application/json, that describes the body, the caller or how to handle the exchange.
- Content-Length — The header that gives the size of the message body in bytes.
- HTTP/1.1 — The text-based version of HTTP in which one connection carries one request and response at a time.
- stream — Data that flows between a program and a source or destination piece by piece, rather than all at once.
Taught in
- App Router Architecture: Server-First Paradigms — Next.js 15 & Modern App Router Architecture
- Streaming SSR: Progressive HTML & Chunked Transfers — Next.js 15 & Modern App Router Architecture
- Streaming Endpoints: Server-Sent Events & NDJSON Feeds — Next.js 15 & Modern App Router Architecture
- Native HTTP Server: Request & Response Lifecycles — Node.js Internals & Backend Services