A persistent connection (HTTP persistent connection) is a network communication channel that remains open for further HTTP requests and responses rather than closing after a single exchange.
HTTP has a persistent connection function that allows the channel to remain open rather than be closed after a requested exchange of data. TCP is a connection-oriented protocol: It starts a connection after confirmation from both ends that they are available and open to a data exchange. In a non-persistent connection, the channel closes when one host signals that it wants to end communications or when a certain amount of time has elapsed with no exchange of data. To maintain a persistent connection, TCP keep-alive packets are sent to prevent the connection from timing out.
An open connection is faster for frequent data exchanges. Communications overhead is saved by leaving a connection open rather than opening and closing sessions for each request. Persistent connections can also be used with APIs to enable servers to push data to clients. Other benefits of persistent connections include reduced network congestion, latency and CPU and memory usage due to the lower number of connections; errors can also be reported without closing the connection.
Persistent connections added for HTTP 1.0 used an extra header to request the client keep the connection alive; HTTP 1.1 assumes all connections to be persistent unless otherwise specified. HTTP 2.0 expands the persistent connection to enable numerous requests and returns of data to be exchanged simultaneously over a single connection.
Persistent connections are also called HTTP keep-alive or HTTP connection reuse.