O'Reilly logo

HTTP/2 in Action by Barry Pollard

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

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:

:authority: www.example.com
:method: GET
:path: /url :scheme: ...

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

Start Free Trial

No credit card required