RFC 2616: HTTP/1.1: Persistent connections and caching
Summary
RFC 2616 of June 1999, written by Roy Fielding, Jim Gettys, Jeffrey Mogul, Henrik Frystyk, Larry Masinter, Paul Leach and Tim Berners-Lee, was the authoritative description of HTTP/1.1 for 15 years. It made persistent connections the norm, required the Host header and regulated caching, chunked transfer and content negotiation. At 176 pages it became so extensive that it was split into six documents in 2014 and into today’s RFC 9110 family in 2022.
What HTTP/1.1 changed
Under HTTP/1.0 a browser set up a separate TCP connection for every resource. RFC 2616 reverses this: persistent connections are the norm, and clients may send requests one after another without waiting for responses. A single client should hold at most two simultaneous connections to a server, a limit browsers later raised considerably.
Every HTTP/1.1 request must contain a Host header. Only this allowed many websites to share the same IP address, the basis of practically all web hosting today. Chunked transfer allows responses whose length is not yet known at the start.
Caching and splitting up
A large part of the document regulates caching: Cache-Control, validation with ETag and If-None-Match, and the behaviour of proxies. These rules still determine how fast websites load and how much load servers carry.
The abundance had its price: ambiguities and contradictions led to differing implementations. In June 2014 RFC 7230 to 7235 replaced the document, and in June 2022 RFC 9110 (semantics), 9111 (caching) and 9112 (HTTP/1.1) reorganised HTTP again and separated semantics from versions.
Ideas
- Persistent connections save repeated TCP handshakes.
- The Host header allows many websites on one IP address.
- Chunked transfer sends responses without a length known in advance.
- Cache-Control and ETags control reuse and validation.
- Clients may send requests back to back without waiting.
- Content negotiation picks language and format to suit the client.
Insights
- The inconspicuous Host header shaped web hosting economically more than some big protocol innovations.
- A standard that regulates too much at once becomes hard to maintain; the splits in 2014 and 2022 were the consequence.
- HTTP performance depends at least as much on connection and cache behaviour as on bandwidth.
Facts
- RFC 2616 appeared in June 1999 and replaces RFC 2068 from January 1997.
- The document has 176 pages.
- Every HTTP/1.1 request must contain a Host header.
- RFC 7230 to 7235 replaced RFC 2616 in June 2014, and RFC 9110 to 9112 replaced those in June 2022.
References
- RFC 2616: Hypertext Transfer Protocol -- HTTP/1.1
- RFC 9110: HTTP Semantics (2022)
- RFC 9111: HTTP Caching (2022)
- RFC 9112: HTTP/1.1 (2022)
Remarks
- In his dissertation in 2000, Roy Fielding described the REST architectural style, which builds on the principles anchored in HTTP/1.1.
Recommendations
- Use RFC 9110 to 9112 rather than RFC 2616 for current questions.
- Set cache headers for static files deliberately and check them with curl -I.
- With virtual hosts, make sure that requests without a matching Host header do not end up on the wrong website.
Read the RFC at the RFC Editor
Found a mistake or have something to add? Get in touch.
Links to the original source and the Web Archive open in a new tab.