HTTP is built on top of Transmission Control Protocol (TCP). In
early implementations of HTTP, each HTTP request required opening a new
socket connection. This is inefficient because many HTTP requests in a
web page go to the same server. For example, most requests for images in
a web page all go to a common image server. Persistent Connections (also known as
Keep-Alive in HTTP/1.0) was
introduced to solve the inefficiency of opening and closing multiple
socket connections to the same server. It lets browsers make multiple
requests over a single connection. Browsers and servers use the
Connection header to indicate Keep-Alive
Connection header looks
the same in the server's response.
The browser or server can close the connection by sending a
Connection: close header.
keep-alive header is not required in HTTP/1.1, but most
browsers and servers still include it.
Pipelining, defined in HTTP/1.1, allows for sending multiple requests over a single socket without waiting for a response. Pipelining has better performance than persistent connections. Unfortunately, pipelining is not supported in Internet Explorer (up ...