Facebook Pixel
Searching...
English
EnglishEnglish
EspañolSpanish
简体中文Chinese
FrançaisFrench
DeutschGerman
日本語Japanese
PortuguêsPortuguese
ItalianoItalian
한국어Korean
РусскийRussian
NederlandsDutch
العربيةArabic
PolskiPolish
हिन्दीHindi
Tiếng ViệtVietnamese
SvenskaSwedish
ΕλληνικάGreek
TürkçeTurkish
ไทยThai
ČeštinaCzech
RomânăRomanian
MagyarHungarian
УкраїнськаUkrainian
Bahasa IndonesiaIndonesian
DanskDanish
SuomiFinnish
БългарскиBulgarian
עבריתHebrew
NorskNorwegian
HrvatskiCroatian
CatalàCatalan
SlovenčinaSlovak
LietuviųLithuanian
SlovenščinaSlovenian
СрпскиSerbian
EestiEstonian
LatviešuLatvian
فارسیPersian
മലയാളംMalayalam
தமிழ்Tamil
اردوUrdu
High Performance Browser Networking

High Performance Browser Networking

What every web developer should know about networking and web performance
by Ilya Grigorik 2013 398 pages
4.52
500+ ratings
Listen

Key Takeaways

1. Network performance fundamentals: Latency and bandwidth

Speed is a feature, and in fact, for some applications it is the feature.

Latency matters more than bandwidth. In most cases, the performance of web applications is limited by latency, not bandwidth. Latency is the time it takes for a message to travel from its point of origin to the point of destination, while bandwidth is the maximum throughput of a logical or physical communication path.

Factors affecting latency:

  • Propagation delay (distance)
  • Transmission delay (data size)
  • Processing delay (network equipment)
  • Queuing delay (network congestion)

Reducing latency is crucial for improving user experience, as humans perceive delays as small as 100-300 milliseconds. To optimize performance, focus on:

  • Minimizing round trips
  • Moving data closer to the client (e.g., using CDNs)
  • Leveraging caching and compression techniques

2. TCP and UDP: The building blocks of internet communication

TCP provides the abstraction of a reliable network running over an unreliable channel.

TCP ensures reliable, ordered delivery. Transmission Control Protocol (TCP) is optimized for accurate delivery rather than timely delivery. It includes features like flow control, congestion control, and error checking, making it suitable for applications that require all data to arrive intact.

Key TCP concepts:

  • Three-way handshake
  • Slow-start algorithm
  • Congestion avoidance

UDP offers speed over reliability. User Datagram Protocol (UDP) is a simpler, connectionless protocol that provides a low-latency and loss-tolerating connection. It's often used for real-time applications like video streaming and online gaming.

UDP characteristics:

  • No guarantee of delivery or ordering
  • No connection state or congestion control
  • Lower overhead and latency

3. The evolution of HTTP: From 0.9 to 2.0

HTTP 2.0 will make our applications faster, simpler, and more robust—a rare combination.

HTTP has constantly evolved to meet web needs. The Hypertext Transfer Protocol (HTTP) has undergone significant changes from its inception to the current HTTP/2 version. Each iteration has brought improvements in performance, functionality, and efficiency.

HTTP evolution timeline:

  • HTTP/0.9 (1991): Simple, one-line protocol
  • HTTP/1.0 (1996): Added headers, methods, and status codes
  • HTTP/1.1 (1997): Introduced keep-alive connections, pipelining
  • HTTP/2 (2015): Multiplexing, header compression, server push

HTTP/2 addresses many limitations of its predecessors, offering:

  • Full request and response multiplexing
  • Header compression
  • Server push capabilities
  • Prioritization of requests

These improvements significantly reduce latency and increase page load speeds, especially for complex web applications.

4. TLS: Securing web communications

Security and performance are not mutually exclusive, and TLS can be optimized to minimize its impact on web application performance.

TLS provides encryption, authentication, and integrity. Transport Layer Security (TLS) is the protocol responsible for securing communications on the web. It ensures that data exchanged between clients and servers remains private and unaltered.

Key components of TLS:

  • Handshake protocol: Authenticates parties and negotiates cryptographic parameters
  • Record protocol: Encrypts and transmits application data

While TLS adds some overhead to web communications, several optimization techniques can minimize its impact:

  • TLS session resumption
  • TLS false start
  • OCSP stapling
  • Elliptic curve cryptography

Implementing these optimizations can significantly reduce the latency introduced by TLS, ensuring both security and performance.

5. Mobile networks: Challenges and optimizations

The performance of your application, especially the first load and the "time to render" depends directly on how this dependency graph between markup, stylesheets, and JavaScript is resolved.

Mobile networks present unique challenges. Mobile networks introduce additional complexities due to higher latencies, lower bandwidths, and less stable connections compared to fixed networks. Understanding these challenges is crucial for optimizing web applications for mobile users.

Key mobile network characteristics:

  • Variable latency and bandwidth
  • Radio Resource Control (RRC) state transitions
  • Power consumption considerations

Optimization strategies for mobile:

  • Minimize and batch network requests
  • Implement efficient caching mechanisms
  • Use compression for data transfers
  • Optimize images and media for mobile devices
  • Leverage offline capabilities (e.g., Service Workers)

By adapting web applications to the unique constraints of mobile networks, developers can significantly improve performance and user experience for mobile users.

6. Browser APIs: XMLHttpRequest, Server-Sent Events, and WebSockets

The fastest network request is a request not made.

Modern browsers offer powerful networking APIs. Web developers have access to a variety of APIs for efficient network communication, each suited for different use cases.

Comparison of browser networking APIs:
XMLHttpRequest (XHR):

  • Traditional method for AJAX requests
  • Supports both sending and receiving data
  • Limited by same-origin policy (unless using CORS)

Server-Sent Events (SSE):

  • Enables server-to-client real-time updates
  • Unidirectional (server to client only)
  • Automatically handles reconnection

WebSockets:

  • Provides full-duplex, bidirectional communication
  • Low latency, suitable for real-time applications
  • Requires special server support

Choosing the right API depends on the specific requirements of your application. For real-time updates, SSE or WebSockets are often more efficient than polling with XHR. However, XHR remains useful for traditional request-response patterns.

7. WebRTC: Enabling peer-to-peer communication in browsers

WebRTC is much more than just another browser API.

WebRTC revolutionizes browser-based communication. Web Real-Time Communication (WebRTC) allows direct peer-to-peer communication between browsers, enabling applications like video calling, file sharing, and collaborative editing without the need for plugins or third-party software.

Key components of WebRTC:

  • MediaStream: Handles audio and video capture
  • RTCPeerConnection: Manages peer connections and data transfer
  • RTCDataChannel: Enables arbitrary data exchange between peers

WebRTC uses UDP as its transport protocol, prioritizing low latency over guaranteed delivery. It incorporates several other protocols to handle various aspects of peer-to-peer communication:

  • ICE, STUN, and TURN for NAT traversal
  • DTLS for securing data transfers
  • SCTP and SRTP for multiplexing and congestion control

While WebRTC opens up new possibilities for web applications, it also introduces complexities in terms of connection establishment and NAT traversal. Developers need to carefully consider these aspects when implementing WebRTC-based features.

Last updated:

Review Summary

4.52 out of 5
Average of 500+ ratings from Goodreads and Amazon.

High Performance Browser Networking is highly praised for its comprehensive coverage of web performance and networking fundamentals. Readers appreciate its in-depth explanations of protocols, wireless networks, and browser APIs. The book is considered essential reading for web developers, offering practical optimization tips and insights into the intricacies of modern web technologies. While some find certain sections challenging or slightly outdated, most reviewers commend the author's ability to explain complex concepts clearly and provide valuable performance optimization strategies for web and mobile applications.

Your rating:

About the Author

Ilya Grigorik is a prominent figure in web performance engineering, currently working at Google. As the co-chair of the W3C Web Performance Working group, he plays a crucial role in shaping web performance standards. Ilya Grigorik is best known for authoring "High Performance Browser Networking," published by O'Reilly. This book has become a go-to resource for developers seeking to optimize web and mobile application performance. Grigorik's expertise in networking protocols, browser technologies, and performance optimization techniques has made him a respected voice in the web development community. His work at Google and contributions to web standards continue to influence the direction of web performance engineering.

Download PDF

To save this High Performance Browser Networking summary for later, download the free PDF. You can print it out, or read offline at your convenience.
Download PDF
File size: 0.85 MB     Pages: 10

Download EPUB

To read this High Performance Browser Networking summary on your e-reader device or app, download the free EPUB. The .epub digital book format is ideal for reading ebooks on phones, tablets, and e-readers.
Download EPUB
File size: 3.51 MB     Pages: 8
0:00
-0:00
1x
Dan
Andrew
Michelle
Lauren
Select Speed
1.0×
+
200 words per minute
Create a free account to unlock:
Bookmarks – save your favorite books
History – revisit books later
Ratings – rate books & see your ratings
Unlock unlimited listening
Your first week's on us!
Today: Get Instant Access
Listen to full summaries of 73,530 books. That's 12,000+ hours of audio!
Day 4: Trial Reminder
We'll send you a notification that your trial is ending soon.
Day 7: Your subscription begins
You'll be charged on Nov 30,
cancel anytime before.
Compare Features Free Pro
Read full text summaries
Summaries are free to read for everyone
Listen to summaries
12,000+ hours of audio
Unlimited Bookmarks
Free users are limited to 10
Unlimited History
Free users are limited to 10
What our users say
30,000+ readers
“...I can 10x the number of books I can read...”
“...exceptionally accurate, engaging, and beautifully presented...”
“...better than any amazon review when I'm making a book-buying decision...”
Save 62%
Yearly
$119.88 $44.99/yr
$3.75/mo
Monthly
$9.99/mo
Try Free & Unlock
7 days free, then $44.99/year. Cancel anytime.
Settings
Appearance