Alt-Svc

This translation is incomplete. Please help translate this article from English

Alt-Svc 全称为“Alternative-Service”,直译为“备选服务”。该头部列举了当前站点备选的访问方式列表。一般用于在提供 “QUIC” 等新兴协议支持的同时,实现向下兼容。

语法

Alt-Svc: clear
Alt-Svc: <service-list>; ma=<max-age>
Alt-Svc: <service-list>; ma=<max-age>; persist=1
<service-list>
使用分号隔离的访问方式列表,格式形如:<service-name>="<host-name>:<port-number>"。这里的<service-name>应当是一个有效的 ALPN 标识符。
<max-age>可选
当前访问方式的有效期,超过该时间后,服务端将不保证该访问方式依旧可用,客户端应当重新获取更新后的 Alt-Svc 列表。单位为秒,默认值为 24 小时(86400)。
persist可选
可选参数,用于标识当前访问方式在网络环境改变时或者会话间始终保持。

说明

说明 状态 描述
RFC 7838 IETF RFC 初始化定义。

浏览器兼容性

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
Alt-SvcChrome Full support YesEdge ? Firefox Full support 38
Full support 38
No support 37 — 38
Notes
Notes Only supports draft-04
No support 35 — 37
Notes Disabled
Notes Only supports draft-03
Disabled From version 35 until version 37 (exclusive): this feature is behind the network.http.altsvc.enabled preference (needs to be set to true) and the altsvc.oe preference (needs to be set to true). To change preferences in Firefox, visit about:config.
IE ? Opera Full support YesSafari ? WebView Android Full support YesChrome Android Full support YesFirefox Android Full support 38
Full support 38
No support 37 — 38
Notes
Notes Only supports draft-04
No support 35 — 37
Notes Disabled
Notes Only supports draft-03
Disabled From version 35 until version 37 (exclusive): this feature is behind the network.http.altsvc.enabled preference (needs to be set to true) and the altsvc.oe preference (needs to be set to true). To change preferences in Firefox, visit about:config.
Opera Android Full support YesSafari iOS ? Samsung Internet Android Full support Yes

Legend

Full support  
Full support
Compatibility unknown  
Compatibility unknown
See implementation notes.
See implementation notes.
User must explicitly enable this feature.
User must explicitly enable this feature.

引用