Chapter 8. HPACK header compression

This chapter covers
  • Background on data compression
  • Why HTTP/2 needed its own compression technique for HTTP headers
  • The HPACK compression format
  • Decompressing HPACK encoded headers
  • HPACK in client and server implementations

The next topic is header compression. HTTP/1 has always allowed HTTP bodies to be compressed, but only since HTTP/2 has it been possible to compress the HTTP headers too.

8.1. Why is header compression needed?

It’s true that, in general, HTTP headers are relatively small in comparison with HTTP bodies, but they’re still chatty and repetitive. A typical HTTP/2 GET request from Chrome looks like this:

:method: GET
:path: /url :scheme: ...

Get HTTP/2 in Action now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.