Managing Connections

The default behavior of an HTTP transaction, prior to HTTP/1.1, was that a TCP connection (see Figure 14.3 for an illustration of a TCP connection) would be established, the HTTP request and response would be exchanged, and the TCP connection would be closed. Consider that most Web pages consist of HTML and a handful of images (all of which must be requested separately), and the inefficiency of this method becomes apparent. One way around this was for the Web server and Web client to agree to use a persistent connection for several consecutive transactions.

Figure 14.3. A TCP connection requires three messages.

Connection ...

Get HTTP Developer’s Handbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.