What every web developer should know about networking and web performance
Ilya Grigorik
Network#
TCP#
UDP#
TLS#
SSE#
WebRTC#
WebSocket#
HTTP#
HTTP2#
UDP#
P2P#
XHR#
3G#
4G#
How prepared are you to build fast and efficient web applications? This eloquent book provides what every web developer should know about the network, from fundamental limitations that affect performance to major innovations for building even more powerful browser applicationsâ??including HTTP 2.0 and XHR improvements, Server-Sent Events (SSE), WebSocket, and WebRTC.
Author Ilya Grigorik, a web performance engineer at Google, demonstrates performance optimization best practices for TCP, UDP, and TLS protocols, and explains unique wireless and mobile network optimization requirements. Youâ??ll then dive into performance characteristics of technologies such as HTTP 2.0, client-side network scripting with XHR, real-time streaming with SSE and WebSocket, and P2P communication with WebRTC.
Our goal is to cover what every developer should know about the network: what protocols are being used and their inherent limitations, how to best optimize your applications for the underlying network, and what networking capabilities the browser offers and when to use them.
In the process, we will look at the internals of TCP, UDP, and TLS protocols, and how to optimize our applications and infrastructure for each one. Then we'll take a deep dive into how the wireless and mobile networks work under the hood--this radio thing, it's very different--and discuss its implications for how we design and architect our applications. Finally, we will dissect how the HTTP protocol works under the hood and investigate the many new and exciting networking capabilities in the browser:
Understanding how the individual bits are delivered, and the properties of each transport and protocol in use are essential knowledge for delivering high-performance applications. After all, if our applications are blocked waiting on the network, then no amount of rendering, JavaScript, or any other form of optimization will help! Our goal is to eliminate this wait time by getting the best possible performance from the network.
High-Performance Browser Networking will be of interest to anyone interested in optimizing the delivery and performance of her applications, and more generally, curious minds that are not satisfied with a simple checklist but want to know how the browser and the underlying protocols actually work under the hood. The "how" and the "why" go hand in hand: we'll cover practical advice about configuration and architecture, and we'll also explore the trade-offs and the underlying reasons for each optimization.
Table of Contents
Part I. Networking 101
Chapter 1. Primer on Latency and Bandwidth
Chapter 2. Building Blocks of TCP
Chapter 3. Building Blocks of UDP
Chapter 4. Transport Layer Security (TLS)
Part II. Performance of Wireless Networks
Chapter 5. Introduction to Wireless Networks
Chapter 6. WiFi
Chapter 7. Mobile Networks
Chapter 8. Optimizing for Mobile Networks
Part III. HTTP
Chapter 9. Brief History of HTTP
Chapter 10. Primer on Web Performance
Chapter 11. HTTP 1.X
Chapter 12. HTTP 2.0
Chapter 13. Optimizing Application Delivery
Part IV. Browser APIs and Protocols
Chapter 14. Primer on Browser Networking
Chapter 15. XMLHttpRequest
Chapter 16. Server-Sent Events (SSE)
Chapter 17. WebSocket
Chapter 18. WebRTC
"This book is required reading for anyone who cares about web performance; it's already established as the go-to reference on the topic." -- Mark Nottingham (IETF HTTPbis Working Group Chair)
Ilya Grigorik is a web performance engineer and developer advocate at Google where he works to make the web faster by building and driving adoption of performance best practices at Google, and beyond.