Chapter 8. HPACK header compression
This chapter covers
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.
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: https accept: text/html,application/xhtml+xml,application/xml;q=0.9, image/webp,image/apng,*/*;q=0.8 accept-encoding: gzip, deflate, br accept-language: en-GB,en-US;q=0.9,en;q=0.8 upgrade-insecure-requests: 1 user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537 .36 (KHTML, like Gecko) Chrome/66.0.3359.139 Safari/537.36 !@%STYLE%@! {"css":"{\"css\": \"font-weight: bold;\"}","target":"[[{\"line\":1,\"ch\":9},{\"line\":1,\"ch\":12}],[{\"line\":2,\"ch\":7},{\"line\":2,\"ch\":11}]]"} !@%STYLE%@!