Skip to main content

Static Table

HPACKRFC 7541

The HPACK static table is a predefined list of 61 common HTTP header name-value pairs shared by all HTTP/2 connections. Both client and server know these entries without any communication. A single integer index (1-61) in a HEADERS frame replaces the full header string. Index 1 = :authority, index 2 = :method GET, index 8 = :status 200. This saves the most bytes for the most common headers.

Details

The static table is defined in RFC 7541 Appendix A and is identical for every HTTP/2 connection in the world.

All 61 entries are fixed. Neither client nor server can add to or remove from the static table. Entries include the most common HTTP/2 pseudo-headers and request/response headers: 1 = :authority (empty value) 2 = :method GET 3 = :method POST 4 = :path / 5 = :path /index.html 6 = :scheme http 7 = :scheme https 8 = :status 200 9 = :status 204 10 = :status 206 11 = :status 304 12 = :status 400 13 = :status 404 14 = :status 500 15 = accept-charset 16 = accept-encoding gzip, deflate 17 = accept-language ...continuing to 61 = www-authenticate

Indexed representation: A HEADERS block byte of 0x82 means: index 2 from the static table = :method GET. No string bytes needed. Just one byte for the entire :method GET header.

Savings: A typical HTTP/2 request contains :method, :path, :scheme, :authority, and several other headers. Many of these are indexed in the static table or the dynamic table, resulting in the 85-90% header size reduction often cited for HTTP/2 vs HTTP/1.1.

Wire example

HEADERS frame encoding
# HTTP/2 HEADERS frame (hex) for GET /api/users
# Static table indexed representations:
82 = :method GET      (index 2, static table)
84 = :path /          (index 4, static table)
87 = :scheme https    (index 7, static table)
# 3 bytes replace: ":method: GET
:path: /
:scheme: https
" (43 bytes)

# For :authority with value api.example.com, no static table entry:
# Literal with incremental indexing (add to dynamic table):
41                    # indexed name (:authority = index 1) + literal value
0f                    # value length 15
61 70 69 2e ...       # "api.example.com" (ASCII, or Huffman-encoded)

See Also