跳到主要内容

Appendix A. 静态表定义 (Static Table Definition)

static table (见 Section 2.3.1) 由预定义且不可更改的 header field 列表组成.

static table 是通过确定热门网站最常用的 header field, 并加入 HTTP/2 特有的 pseudo-header field (见 [HTTP2] 的 Section 8.1.2.1) 而创建的.

对于出现在 static table 中的 header field, 名称始终作为对 static table 条目的引用发送, 值则作为对 static table 条目的引用发送, 或编码为 literal.

下表按顺序列出 static table 的条目. "Index" 列给出条目的索引. "Header Name" 列给出 header field 的名称. "Header Value" 列给出为该 header field 存储的值.

编码器可以通过 indexed header field representation 直接引用这些条目, 或者在 literal header field representation 中只引用其中的 header name. 解码器 MUST 使用完全相同的索引和值解释该表, 因为 static table 不随连接状态变化, 也不受 dynamic table size update 影响. 空的 Header Value 表示该条目只预定义了 header name, 具体值需要在编码的 header block 中另行提供.

该表中的 pseudo-header fields (例如 :method, :path, :scheme:status) 来自 HTTP/2 语义. 其他条目是常见 HTTP header fields. 表项顺序是协议的一部分, 因而索引号, header name 和预定义 header value 都必须保持不变.

Index (索引)Header Name (头字段名称)Header Value (头字段值)
1:authority
2:methodGET
3:methodPOST
4:path/
5:path/index.html
6:schemehttp
7:schemehttps
8:status200
9:status204
10:status206
11:status304
12:status400
13:status404
14:status500
15accept-charset
16accept-encodinggzip, deflate
17accept-language
18accept-ranges
19accept
20access-control-allow-origin
21age
22allow
23authorization
24cache-control
25content-disposition
26content-encoding
27content-language
28content-length
29content-location
30content-range
31content-type
32cookie
33date
34etag
35expect
36expires
37from
38host
39if-match
40if-modified-since
41if-none-match
42if-range
43if-unmodified-since
44last-modified
45link
46location
47max-forwards
48proxy-authenticate
49proxy-authorization
50range
51referer
52refresh
53retry-after
54server
55set-cookie
56strict-transport-security
57transfer-encoding
58user-agent
59vary
60via
61www-authenticate