Chapter 4. HTTP/2 protocol basics

 

This chapter covers

  • The basics of HTTP/2: what it is and how it differs from HTTP/1.1
  • How client and server agree to use HTTP/2 instead of HTTP/1.1
  • HTTP/2 frames and how to debug them

This chapter covers the basics of HTTP/2 (frames, streams, and multiplexing). I discuss more advanced parts of the protocol (in particular, stream prioritization and flow control) in chapters 7 and 8. The HTTP/2 specification[1] is the ultimate reference point for the protocol and can be referred to after or in conjunction with this chapter, but the added detail and examples in this chapter will (I hope) make learning the protocol easier.

4.1. Why HTTP/2 instead of HTTP/1.2?

I touched on the differences between HTTP/1 and HTTP/2 in chapter 2. HTTP/2 was created specifically to address performance problems in HTTP/1, and the new version of the protocol differs by adding the following concepts:

  • Binary rather than textual protocol
  • Multiplexed rather than synchronous
  • Flow control
  • Stream prioritization
  • Header compression
  • Server push

4.2. How an HTTP/2 connection is established

4.3. HTTP/2 frames

Summary

sitemap