HTTP/3 是HTTP 协议的第三个主要版本,用于在万维网 上交换信息。与之前版本(HTTP/1.1 和HTTP/2 )不同,HTTP/3不依赖TCP 协议,转为使用基于UDP 协议的多路复用 传输协议QUIC 协议实现。[ 1]
此变化主要为了解决HTTP/2中存在的队头阻塞 问题。由于HTTP/2在单个TCP连接上使用了多路复用 ,受到TCP拥塞控制 的影响,少量的丢包就可能导致整个TCP连接上的所有流被阻塞。
与该协议的早期版本相比,HTTP/3使用相似的语义,包括相同的请求方法 、状态代码 和消息字段 ,但编码方式和会话状态的维护方式有所不同。然而,部分由于该协议采用了QUIC,与之前的版本相比,HTTP/3在实际使用中具有更低的延迟和更快的加载速度:在某些情况下,速度是HTTP/1.1(是许多网站唯一部署的HTTP版本)的四倍以上。[ 2] [ 3]
截至2024年9月,超过95%的主流网络浏览器支持HTTP/3[ 4] ,并且在排名前1000万的网站中,有34%的网站支持HTTP/3。[ 5]
历史
Protocol stack of HTTP/3 compared to HTTP/1.1 and HTTP/2
HTTP/3起源于QUIC工作组采纳的互联网草案 。最初的提案名为“HTTP/2 Semantics Using The QUIC Transport Protocol”[ 6] (使用QUIC传输协议的HTTP/2语义),后来更名为“Hypertext Transfer Protocol (HTTP) over QUIC”[ 7] 。
在2018年10月28日的一次邮件列表讨论中,IETF HTTP和QUIC工作组主席Mark Nottingham提议将HTTP-over-QUIC更名为HTTP/3,以“清晰地表明它是HTTP语义到线路协议的另一种绑定方式……让人们意识到其与QUIC的分离”。[ 8] Nottingham的提议在几天后被其他IETF成员接受。[ 9] HTTP工作组受命在HTTP/3的设计期间协助QUIC工作组,然后在发布后承担维护责任。[ 10]
Chrome (Canary build)在2019年9月添加了对HTTP/3的支持,然后最终在稳定版本中实现,但默认情况下通过功能标志禁用。它在2020年4月默认启用。[ 11] Firefox在2019年11月通过功能标志添加了对HTTP/3的支持[ 4] [ 12] [ 13] ,并于2021年4月在Firefox 88中开始默认启用。[ 4] [ 14] 2020年4月8日在Safari Technology Preview中添加了对HTTP/3的实验性支持[ 15] ,并包含在随iOS 14 和macOS 11 一起发布的Safari 14中[ 16] [ 17] ,但截至macOS和iOS上的Safari 16,它仍然默认禁用。[來源請求]
2022年6月6日,IETF 在RFC 9114 中将HTTP/3发布为提议标准 。
相较于HTTP/1.1与HTTP/2
不同HTTP版本之间的语义保持一致,如请求方法 、状态代码 和消息字段 等通常在所有版本中都适用。差异在于这些语义到底层传输的映射。HTTP/1.1 和HTTP/2 都使用TCP 作为其传输协议。HTTP/3采用QUIC ,一种传输层 网络协议 ,基于用户数据报协议 (UDP)实现了用户空间 拥塞控制 。QUIC的引入旨在解决HTTP/2中被称为 “队头阻塞 ” 的主要问题:由于HTTP/2多路复用的并行性对TCP的丢失恢复机制 是不可见的,因此一旦发生数据包 丢失或重排序,所有活跃的事务 都会停滞,无论该事务是否受到丢失数据包的影响。相较之下,QUIC提供了原生多路复用,因此丢包只会影响数据真正丢失的那些流。
提议的DNS资源记录 SVCB(由服务绑定)和HTTPS将允许在不首先通过先前的HTTP版本接收Alt-Svc标头的情况下进行连接,从而消除TCP握手的1个RTT。[ 18] [ 19] 自Firefox 92、iOS 14、报告的Safari 14支持以来,以及Chromium在标志后支持HTTPS资源记录。[ 20] [ 21] [ 22]
实现
客户端
HTTP/3 浏览器支持
浏览器
实现但默认禁用的起始版本
默认开启的起始版本
备注
Chrome
稳定版 (79)
2019年12月
87[ 23]
2020年4月[ 24]
早期版本实现了QUIC的其他草案
Edge
稳定版 (79)
2019年12月
87
2020年4月
Edge 79是基于Chromium的首个版本
Firefox
稳定版 (72.0.1)
2020年1月
88[ 25]
2021年4月[ 26]
Safari
稳定版 (14.0)
2020年9月
16.4
2023年3月
Apple从Safari 16.4开始,对部分Safari用户测试HTTP/3的支持。[ 27]
库
为 QUIC and HTTP/3 实现了客户端或服务器逻辑的开源库有[ 28]
服务器
参考资料
^ Bishop, M. Hypertext Transfer Protocol (HTTP) over QUIC . IETF RFC. 2018-10-24 [2018-12-17 ] . (原始内容存档 于2018-12-19).
^ Perna, Gianluca; Trevisan, Martino; Giordano, Danilo; Drago, Idilio. A first look at HTTP/3 adoption and performance . Computer Communications. 2022-04-01, 187 : 115–124 [2025-03-15 ] . ISSN 0140-3664 . S2CID 246936473 . doi:10.1016/j.comcom.2022.02.005 . hdl:11368/3025202 . (原始内容存档 于2023-12-07) (英语) .
^ HTTP/3 is Fast . Request Metrics. [2022-07-01 ] . (原始内容存档 于2025-03-06) (英语) .
^ 4.0 4.1 4.2 " HTTP/3" | Can I use... Support tables for HTML5, CSS3, etc . canIuse.com. [2024-08-11 ] . (原始内容存档 于2025-02-22).
^ Usage of HTTP/3 for websites . World Wide Web Technology Surveys. W3Techs. [11 August 2024] .
^ Shade, Robbie. HTTP/2 Semantics Using The QUIC Transport Protocol . IETF . 8 July 2016. I-D draft-shade-quic-http2-mapping.
^ Cimpanu, Catalin. HTTP-over-QUIC to be renamed HTTP/3 . ZDNet. 12 November 2018 [12 November 2018] . (原始内容存档 于2018-11-13) (英语) .
^ Nottingham, Mark. Identifying our deliverables . IETF Mail Archive. 28 October 2018 [2018-12-17 ] . (原始内容存档 于2018-11-19).
^ Cimpanu, Catalin. HTTP-over-QUIC to be renamed HTTP/3 | ZDNet . ZDNet. 2018-11-12 [2018-11-12 ] . (原始内容存档 于2018-11-13) (英语) .
^ Hypertext Transfer Protocol Charter . ietf.org. [2020-09-02 ] .
^ Enabling QUIC in tip-of-tree . groups.google.com. [2021-04-08 ] . (原始内容存档 于2021-08-23).
^ Daniel, Stenberg. Daniel Stenberg announces HTTP/3 support in Firefox Nightly . Twitter. [5 November 2019] . (原始内容存档 于2023-03-30).
^ Cimpanu, Catalin. Cloudflare, Google Chrome, and Firefox add HTTP/3 support . ZDNet. 26 Sep 2019 [27 Sep 2019] . (原始内容存档 于2019-09-26).
^ {{Cite web|last=Damjanovic|first=Dragana|date=16 April 2021|title=QUIC and HTTP/3 Support now in Firefox Nightly and Beta|url=https://hacks.mozilla.org/2021/04/quic-and-
QUIC(快速UDP网络连接)是一种实验性的网络传输协议 ,由Google 开发,该协议旨在使网页传输更快。在2018年10月28日的邮件列表讨论中,互联网工程任务组 (IETF) HTTP和QUIC工作组主席Mark Nottingham 提出了将HTTP-over-QUIC更名为HTTP/3的正式请求,以“明确地将其标识为HTTP语义的另一个绑定……使人们理解它与QUIC的不同”,并在最终确定并发布草案后,将QUIC工作组继承到HTTP工作组。<ref>Nottingham, Mark. Identifying our deliverables . IETF Mail Archive. 28 October 2018 [2018-12-17 ] . (原始内容存档 于2018-11-19).
^ Release Notes for Safari Technology Preview 104 . webkit.org. 8 April 2020 [7 August 2020] . (原始内容存档 于2025-01-16).
^ Safari 14 Release Notes . developer.apple.com. [4 December 2020] .
^ Ng, Gary. Apple's Safari Adds Support for HTTP3 in iOS 14 and macOS 11 . iphoneincanada.ca. 23 June 2020 [25 June 2021] .
^ HTTPS RR . MDN . Mozilla . [2022-10-25 ] .
^ Schwartz, Benjamin M.; Bishop, Mike; Nygren, Erik. Service binding and parameter specification via the DNS . IETF . 2020-06-12. I-D draft-ietf-dnsop-svcb-https.
^ Firefox 92 for developers . Mozilla Corporation . 7 September 2021 [2022-10-25 ] . (原始内容存档 于2025-02-27).
^ Feature: HTTP->HTTPS redirect for HTTPS DNS records . Google Inc. [2022-10-25 ] . (原始内容存档 于2025-02-13).
^ Patrick Mevzek. What's the use case of SVCB (type 65, service binding) RR . Stack Exchange Inc. 24 August 2021 [2022-10-25 ] .
^ " HTTP/3" | Can I use... Support tables for HTML5, CSS3, etc . canIuse.com. [2023-07-10 ] . (原始内容存档 于2023-07-13).
^ Enabling QUIC in tip-of-tree . groups.google.com. [2021-04-09 ] . (原始内容存档 于2021-08-23).
^ Damjanovic, Dragana. QUIC and HTTP/3 Support now in Firefox Nightly and Beta . Mozilla Hacks – the Web developer blog. 16 April 2021 [2021-04-17 ] . (原始内容存档 于2021-09-18) (美国英语) .
^ Firefox Release Owners - MozillaWiki . wiki.mozilla.org. [2021-04-09 ] . (原始内容存档 于2023-06-08).
^ Jen Simmons. HTTP/3 support shipped in Safari 14.0 . GitHub. 2023-04-04 [2023-04-07 ] . (原始内容存档 于2023-06-06).
^ QUIC Implementations . GitHub. [2021-04-08 ] . (原始内容存档 于2021-07-15) (英语) .
^ First HTTP/3 with curl . Daniel Stenberg. August 5, 2019 [October 2, 2019] . (原始内容存档 于2023-06-06).
^ HTTP3 (and QUIC) . Daniel Stenberg. August 23, 2023 [August 27, 2023] . (原始内容存档 于2023-08-27).
^ MsQuic is Open Source . April 28, 2020 [April 28, 2020] . (原始内容存档 于2022-02-08).
^ HTTP/3 support in .NET 6 . September 17, 2021 [September 17, 2021] . (原始内容存档 于2023-05-30).
^ HTTP/3 support in .NET 6 . .NET Blog. 2021-09-17 [2022-01-12 ] . (原始内容存档 于2023-05-30) (美国英语) .
^ LiteSpeed Web Server Release Log - LiteSpeed Technologies . www.litespeedtech.com. [2022-02-12 ] . (原始内容存档 于2023-08-15). Enable HTTP/3 v1 by default.
^ Release 2.6.0 · caddyserver/caddy . Github. 2022-09-22 [2022-09-20 ] . (原始内容存档 于2023-08-10) (美国英语) .
^ Introducing a Technology Preview of NGINX Support for QUIC and HTTP/3 . NGINX. 2020-06-10 [2020-06-11 ] . (原始内容存档 于2020-06-10) (美国英语) .
^ Binary Packages Now Available for the Preview NGINX QUIC+HTTP/3 Implementation . NGINX. 2023-02-08 [2023-03-30 ] . (原始内容存档 于2023-09-28) (美国英语) .
^ Experiment with HTTP/3 using NGINX and quiche . The Cloudflare Blog. 2019-10-17 [2019-11-09 ] . (原始内容存档 于2019-11-09) (英语) .
^ Tratcher. Use ASP.NET Core with HTTP/3 on IIS . docs.microsoft.com. [2022-04-29 ] (美国英语) .
^ Announcing HAProxy 2.6 . HAProxy Blog. 31 May 2022.
^ QUIC Implementation in HAProxy . HAProxyConf video presentation. [2023-10-14 ] . (原始内容存档 于2023-07-14).
^ HTTP/3 and QUIC support in Nimble Streamer – Softvelum: efficient tools to build your streaming networks . 2025-02-13 [2025-03-15 ] (美国英语) .
外部链接