Headers
In HTTP/1.x headers are systematically sent in any request or response, in plain text. This is a big waste of bandwidth, that HTTP/2 improves by applying HPACK compression on the HEADER
frames.
As said before, the purpose of HTTP/2 is to improve performance by reinventing the encoding, but keeping the syntax. This is to preserve the headers as they are, and it’s just the way they will be transferred.
HPACK compression uses three methods:
- Static Dictionary: 61 commonly used headers are predefined with default values, so that nothing is defined on the first request, and nothing is sent over the network.
- Dynamic Dictionary: if new headers are sent over the transmission, they are added into the dictionary in order to prevent sending them in further messages.
- Huffman Encoding: an algorithm for the compression of ASCII characters in the HTTP Headers context. Each character is associated to a bit code. The more frequent a character will be, the shorter its bit code will be....