http-2.0-中文版

上传人:命****币 文档编号:106669533 上传时间:2019-10-15 格式:DOC 页数:174 大小:1,023.12KB
返回 下载 相关 举报
http-2.0-中文版_第1页
第1页 / 共174页
http-2.0-中文版_第2页
第2页 / 共174页
http-2.0-中文版_第3页
第3页 / 共174页
http-2.0-中文版_第4页
第4页 / 共174页
http-2.0-中文版_第5页
第5页 / 共174页
点击查看更多>>
资源描述

《http-2.0-中文版》由会员分享,可在线阅读,更多相关《http-2.0-中文版(174页珍藏版)》请在金锄头文库上搜索。

1、HTTP 全称为 HyperText Transfer Protocol,中文叫做超文本传输协议。用于 Web应用层传输,是 Web 架构的核心,它至今公布有 3 个版本: HTTP 0.9,只有基本的文本 GET 功能。 HTTP 1.0,完善的请求/响应模型,并将协议补充完整。 HTTP 1.1,在 1.0 基础上进行更新,增加了如 长久连接 keep-alive 与 chunked 等功能。距最近 1999 年 6 月HTTP 1.1 RFC 2616发布以来至今已有 15 年。而 HTTP 2.0 首个 draft 已于 2012 年 11 月发布,预计到明年初正式发布。它保证了与 H

2、TTP 1.1 的完全语义兼容,最初考虑的是 Google SPDY 协议、微软的 SM 协议和 Network-Friendly HTTP 更新。最终各方推荐了 SPDY 协议,并在此基础上进行了相应更新。HTTP 2.0 相比 1.1 的更新大部分集中于: 多路复用 HEAD 压缩 服务器推送 优先级请求作为与时俱进的我们,有必要去了解和学习 HTTP 2.0,它对我们未来 Web 性能优化工作起到很重要的作用,是一切优化的基础。现 Chrome 里也已使用 SPDY。今天我们很高兴和大家分享一则信息,由 FEX 的 zhangtao 等同学们,业余花费近半年时间翻译的 HTTP 2.0

3、草案发布。viaHTML5 中国附上 zhangtao 的Github 原文:IETF HTTP2草案(draft-ietf-httpbis-http2-13)摘要本规范描述了一种优化的超文本传输协议(HTTP)。HTTP/2通过引进报头字段压缩以及多路复用来更有效利用网络资源、减少感知延迟。另外还介绍了服务器推送规范。本文档保持对HTTP/1.1的后向兼容,HTTP的现有的语义保持不变。1 介绍The Hypertext Transfer Protocol (HTTP) is a wildly successful protocol. However, the HTTP/1.1 messag

4、e format (RFC7230, Section 3) was designed to be implemented with the tools at hand in the 1990s, not modern Web application performance. As such it has several characteristics that have a negative overall effect on application performance today.超文本传输协议(HTTP)是一个非常成功的协议。 但是HTTP/1.1 是针对90年代的情况而不是现代web

5、应用的性能而设计的,导致它的一些特点已经对现代应用程序的性能产生负面影响。In particular, HTTP/1.0 only allows one request to be outstanding at a time on a given connection. HTTP/1.1 pipelining only partially addressed request concurrency and suffers from head-of-line blocking. Therefore, clients that need to make many requests typicall

6、y use multiple connections to a server in order to reduce latency.特别是,HTTP/1.0只允许在一个连接上建立一个当前未完成的请求。HTTP/1.1管道只部分处理了请求并发和报头阻塞的问题。因此客户端需要发起多次请求通过数次连接服务器来减少延迟。Furthermore, HTTP/1.1 header fields are often repetitive and verbose, which, in addition to generating more or larger network packets, can caus

7、e the small initial TCP TCP congestion window to quickly fill. This can result in excessive latency when multiple requests are made on a single new TCP connection.此外,HTTP/1.1的报头字段经常重复和冗长。在产生更多或更大的网络数据包时,可能导致小的初始TCP堵塞窗口被快速填充。这可能在多个请求建立在一个新的TCP连接时导致过度的延迟。This specification addresses these issues by de

8、fining an optimized mapping of HTTPs semantics to an underlying connection. Specifically, it allows interleaving of request and response messages on the same connection and uses an efficient coding for HTTP header fields. It also allows prioritization of requests, letting more important requests com

9、plete more quickly, further improving performance.本协议通过定义一个优化的基础连接的HTTP语义映射来解决这些问题。 具体地,它允许在同一连接上交错地建立请求和响应消息,并使用高效率编码的HTTP报头字段。 它还允许请求的优先级,让更多的重要的请求更快速的完成,进一步提升了性能。The resulting protocol is designed to be more friendly to the network, because fewer TCP connections can be used in comparison to HTTP/

10、1.x. This means less competition with other flows, and longer-lived connections, which in turn leads to better utilization of available network capacity.最终协议设计为对网络更友好,因为它相对HTTP/1.x减少了TCP连接。 这意味着与其他流更少的竞争以及更长时间的连接,从而更有效地利用可用的网络容量。Finally, this encapsulation also enables more efficient processing of m

11、essages through use of binary message framing.最后,这种封装也通过使用二进制消息帧使信息处理更具扩展性。2 HTTP / 2协议概述HTTP/2 provides an optimized transport for HTTP semantics. HTTP/2 supports all of the core features of HTTP/1.1, but aims to be more efficient in several ways.HTTP/2 提供了HTTP语义的传输优化。HTTP/2支持所有HTTP1.1的核心特征,并且在不同的方

12、面做的更高效。The basic protocol unit in HTTP/2 is a frame (Section 4.1). Each frame type serves a different purpose. For example, HEADERS and DATA frames form the basis of HTTP requests and responses (Section 8.1); other frame types like SETTINGS, WINDOW_UPDATE, and PUSH_PROMISE are used in support of oth

13、er HTTP/2 features.HTTP/2中基本的协议单位是帧。每个帧都有不同的类型和用途。例如,报头(HEADERS)和数据(DATA)帧组成了基本的HTTP 请求和响应;其他帧例如 设置(SETTINGS),窗口更新(WINDOW_UPDATE), 和推送承诺(PUSH_PROMISE)是用来实现HTTP/2的其他功能。Multiplexing of requests is achieved by having each HTTP request-response exchanged assigned to a single stream (Section 5). Streams

14、are largely independent of each other, so a blocked or stalled request does not prevent progress on other requests.请求多路复用是通过在一个流上分配多个HTTP请求响应交换来实现的(章节5)。流在很大程度上是相互独立的,因此一个请求上的阻塞或终止并不会影响其他请求的处理。Flow control and prioritization ensure that it is possible to properly use multiplexed streams. Flow contro

15、l (Section 5.2) helps to ensure that only data that can be used by a receiver is transmitted. Prioritization (Section 5.3) ensures that limited resources can be directed to the most important requests first.流量控制和优先级能确保正确使用复用流。流量控制(章节5.2)有助于确保只传播接受者需要使用的数据数据。优先级(章节5.3)能确保有限的资源能优先被重要的请求使用。HTTP/2 adds

16、a new interaction mode, whereby a server can push responses to a client (Section 8.2). Server push allows a server to speculatively send a client data that the server anticipates the client will need, trading off some network usage against a potential latency gain. The server does this by synthesizing a request, which it sends as a PUSH_PROMISE frame. The server is then able to s

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 中学教育 > 教学课件 > 高中课件

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号