[x^2 for x in lst]

HTTP/2 In Action

Author: Barry Pollard

Review created: 2019-10-04

HTTP/2 in Action by Barry Pollard is a in-depth treatment of the HTT/2 protocol. It describes the history of the HTTP protocol: the different versions that exist, the problems that each version has and how HTTP/2 attempts to solve them.

The book is divide into four parts:

  • Moving to HTTP/2
  • Using HTTP/2
  • Advanced HTTP/2
  • The feature of HTTP

Part one describes some basics of Internet in general and HTTP in particular. It consists of three chapters:

  • Web technologies and HTTP
  • The road to HTTP/2
  • Upgrading to HTTP/2

The first of these chapters describes the history of HTTP and the versions of it that exists in production today. Tools that can be used to debug and analyse network traffic are treated in some depth. The chapter also contains a highly useful introduction to HTTPS.

In the second chapter some of the problems with HTTP 1.1, and thus the rationale for the need of a new version of the protocol, are described. It also contain a little bit about the protocol, SPDY, from which HTTP/2 was derived. In the end of the chapter, just to set the expectations, some measurements are presented which indicates that HTTP/2 does not solve all of the problems with the previous protocol version.

The third chapter (in conjunction with the appendix) contains a primer on how to enable HTTP/2 on some of the most commonly used web servers and how to do troubleshooting when something does not work as expected. I think that the idea of first describing how to set up a webserver that uses HTTP/2 before going into more details about how the protocol works is a really good one. That way you can try out the stuff that is described in later chapters during the time you read the book.

The second part of the book describes the main parts HTTP/2 protocol in detail. You learn that HTTP/2 is a binary protocol (in contrast to the older versions which were all text based) that uses the concept of streams to allow several requests to be processed in parallel using a single TCP connection. You also learn something about the HTTP/2 push functionality that can be used by server to send data to a client (most often a browser) before it has asked for it. Some advice about how to optimize the usage of HTTP/2 is also given.

The third part of the book treats more advanced concepts of the protocol. The different states that a steam can be in are described, as is flow control and stream priorities.

In the final part of the book, the author speculates about what might come in the future regarding the HTTP protocol. Problems with TCP and possible remedies in form of a new protocol called QUIC are described.

HTTP/2 in Action is written in a clear, easy-to-read way. It is clear the that author really know what he's talking about and that he is passionate about the topic he's writing about. The stuff in the book contains a really deep dive into HTTP/2. The different frames that are available, in what order a web server will send them, how to handle prioritization and flow control; all of those topics are included.

So what is the target audience of the book? If you're going to implement a web server that should be able to handle HTTP/2, I think that this book could serve as a companion guide to the HTTP/2 specification. I.e. you should first read the book and then the spec. The same is true if you are working on implementing a browser.

If you are a web developer who want to use HTTP/2 on your web site and want to know how to do it in the best possible manner or if you are just interested in the HTTP protocol stack, this book is also for you. If you don't fall into one of those categories, then don't buy this book. It is a book about a protocol. It is not possible to make such a book exciting if you are not really a protocol nerd ;)

Having said that, I think the author does a good job of presenting the topic as well as possible. As a person that has worked a bit, but not overly much with the HTTP protocol, HTTP/2 in Action is a good introduction not only to HTTP/2 but also to some other stuff, e.g. performance problems, about HTTP 1.1 that I didn't know about before. I cannot say that I will use all details about HTTP/2 that I learned when reading the book, but it is still useful and interesting to have gotten an introduction to the protocol. Hopefully I will remember the overall structure and the main parts of the protocol if I ever get to work with it.

I read the book on a tablet (AdLibris Letto 2), which made the pictures look really bleak. That meant the my impression of the book was that it was a bit dull. When I checked out the PDF version of the book before writing this review, it looked much more interesting. A take away from this could therefore be to from time to time take a look a book in another format when reading it in ePub or kindle format.

Summary: HTTP/2 in Action is a really deep introduction to the HTTP/2 protocol. If you are interested in learning more about that protocol, read the book, you will not be disappointed! If you are not interested in the HTTP family of protocols, then there are better books to read. Perhaps one about Python? ;)