O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Learning HTTP/2, 1st Edition

Book Description

With Early Release ebooks, you get books in their earliest form—the author's raw and unedited content as he or she writes—so you can take advantage of these technologies long before the official release of these titles. You'll also receive updates when significant changes are made, new chapters are available, and the final ebook bundle is released.

What can your organization gain by adopting HTTP/2? How about faster, simpler, and more robust websites and applications? This practical guide demonstrates how the latest version of the Hypertext Transfer Protocol can dramatically improve website and application performance. You’ll take a deep dive into HTTP/2 details, and learn how this updated protocol is changing the web landscape.

HTTP/1.1 has been the primary means of communicating data across the Web for the past 20 years, but the level of interaction today has gone well beyond what people envisioned in 1997. With this book, authors Stephen Ludin and Javier Garza show you how HTTP/2 will help speed the execution of modern sites and applications.

With this book, you’ll explore:

  • Performance challenges that led to the HTTP upgrade
  • HTTP/2 in a nutshell, including benefits and transition methods
  • How Google’s SPDY networking protocol paved the way for HTTP/2
  • Existing best practices and hacks to improve web performance
  • HTTP/2 support for browsers, servers, proxies, and content delivery networks
  • How the performance of sites using HTTP/2 compares to their HTTP/1.1 experience—including the good, bad, and the ugly
  • HTTP/2’s effect on specific issues such as latency, packet loss, and Time to First Byte (TTFB)

Table of Contents

  1. Preface
    1. Who Should Read This Book
    2. What This Book Isn’t
    3. Recommended Resources
    4. Conventions Used in This Book
    5. Using Code Examples
    6. O’Reilly Safari
    7. How to Contact Us
    8. Acknowledgments
  2. Foreword
  3. 1. The Evolution of HTTP
    1. HTTP/0.9 and 1.0
    2. HTTP/1.1
    3. Beyond 1.1
    4. SPDY
    5. HTTP/2
  4. 2. HTTP/2 Quick Start
    1. Up and Running
    2. Get a Certificate
      1. Use an Online Generator
      2. Self Signed
      3. Let’s Encrypt
    3. Get and Run Your First HTTP/2 Server
    4. Pick a Browser
  5. 3. How and Why we Hack the Web
    1. Performance Challenges Today
      1. The Anatomy of a Web Page Request
      2. Critical Performance
      3. The Problems with HTTP/1
    2. Web Performance Techniques
      1. Best Practices for Web Performance
      2. Anti-Patterns
      3. Spriting and resource consolidation/inlining
      4. Sharding
      5. Cookie-less domains
    3. Summary
  6. 4. Transition to HTTP/2
    1. Browser Support
    2. Moving to TLS
    3. Undoing HTTP 1.1 “Optimizations”
    4. Third Parties
    5. Supporting Older Clients
    6. Summary
  7. 5. The HTTP/2 Protocol
    1. Layers of HTTP/2
    2. The Connection
    3. Frames
    4. Streams
      1. Messages
      2. Flow Control
      3. Priority
    5. Server Push
      1. Pushing an Object
      2. Choosing What to Push
    6. Header Compression (HPACK)
    7. On the Wire
      1. A simple GET
    8. Summary
  8. 6. HTTP/2 Performance
    1. Client implementations
    2. Latency
    3. Packet loss
    4. Server Push
    5. Time to First Byte (TTFB)
    6. Third Parties
    7. HTTP/2 anti-patterns
      1. Domain sharding
      2. Inlining
      3. Concatenating
      4. Cookie-less domains
      5. Spriting
      6. Prefetch
    8. Real World Performance
      1. Performance Measurement Methodology
      2. Study 1: www.facebook.com
      3. Study 2: www.yahoo.com
    9. Summary
  9. 7. HTTP/2 Implementations
    1. Desktop Web Browsers
      1. TLS Only
      2. Disabling HTTP/2
      3. Support for HTTP/2 Server Push
      4. Connection Coalescing
      5. HTTP/2 Debugging Tools
      6. Beta Channel
    2. Mobile
    3. Mobile App support
    4. Servers, Proxies, and Caches
    5. Content Delivery Networks (CDNs)
    6. Summary
  10. 8. Debugging h2
    1. Web Browser Developer Tools
      1. Chrome Developer Tools
      2. Firefox Developer tools
      3. Debugging h2 on iOS using Charles Proxy
      4. Debugging h2 on Android
    2. Web Page Test
    3. OpenSSL
      1. OpenSSL commands
    4. nghttp2
      1. Using nghttp
    5. curl
      1. Using curl
    6. h2i
    7. Wireshark
    8. Summary
  11. 9. What is Next?
    1. TCP or UDP?
    2. QUIC
    3. TLS 1.3
    4. HTTP/3?
    5. Summary
  12. A. HTTP/2 Frames
    1. The Frame Header
    2. DATA
    3. HEADERS
    4. PRIORITY
    5. RST_STREAM
    6. SETTINGS
    7. PUSH_PROMISE
    8. PING
    9. GOAWAY
    10. WINDOW_UPDATE
    11. CONTINUATION
  13. B. Tools Reference
  14. Index