Chapter 13
The physical properties of the communication channel set hard performance limits on every application. Speed of light and distance between client and server dictate the propagation latency, and the choice of medium (wired vs. wireless) determines the processing, transmission, queueing, and other delays incurred by each data packet. In fact, the performance of most web apps is limited by latency, not by bandwidth. While bandwidth speeds continue to increase, the same cannot be said for latency. As a result, while we cannot make the bits travel any faster, it is crucial that we apply all the possible optimizations at the transport and application layers to eliminate unnecessary round trips, requests, and minimize the distance traveled by each packet.
- Latency is the bottleneck, and the fastest bits are bits not sent.
Caching resources on the client
- The
cache-controlheader can specify the cache lifetime of a resource - The
last-modifiedandETagheaders provide validation mechanisms for cached resources - You need to specify both the
cache-controlandlast-modifiedheaders. You cannot use one OR the other.
Optimizing for HTTP 2.0
At a minimum:
- Server should start with a TCP CWND of 10 segments
- Server should support TLS with ALPN negotiation
- Server should support TLS connection reuse to minimize handshake latency