keep-alive
Keeping a TCP connection open after an HTTP response so the same client can send further requests over it.
In more detail
Reuse avoids the cost of a new connection and TLS handshake for every request. Servers close idle ones after a timeout to free resources.
Example
HTTP/1.1 streaming endpoints set Connection: keep-alive so the response can stay open.Related terms
- Server-Sent Events — A standard way for a server to keep an HTTP response open and push a stream of text events to the client, in one direction only.
- HTTP — The protocol web browsers and web servers use to send requests and responses.
- HTTP/1.1 — The text-based version of HTTP in which one connection carries one request and response at a time.
- TCP — The internet protocol that delivers data between programs reliably and in order, used by the web and most databases.
- HTTP server timeouts — Node.js HTTP server settings that close connections which stay idle or send their request too slowly.
Taught in
- 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