官术网_书友最值得收藏!

Enabling HTTP/2 on NGINX

The now ratified HTTP/2 standard is based on SPDY, an experimental protocol that Google developed internally. As shown in the diagram in the previous recipe, establishing an HTTPS connection can be quite time consuming. With HTTP/1.1, each connection to the web server must follow this process and wait for the handshake to complete.

In HTTP/2, this handshake time is reduced, but more importantly the requests are multiplexed over a single TCP connection. This means that the handshake only has to occur once, significantly reducing the latency of a site for the end user. In fact, it means that an HTTP/2-based site can actually be quicker than a standard HTTP-based one.

There are a number of other benefits that HTTP/2 also provides, such as header compression, a new binary protocol, and a server-based push. All of these further increase the efficiency of HTTP/2, yet it also remains backwards compatible with HTTP/1.1:

HTTP/2 support
Source: caniuse.com (April 2017)

All modern browsers (as shown in the preceding figure) support HTTP/2 natively, so it's ready to deploy in production. NGINX officially supported HTTP/2 starting with version 1.9.5.

主站蜘蛛池模板: 呼伦贝尔市| 黄石市| 平乡县| 大兴区| 淮北市| 通海县| 安西县| 舞钢市| 淮南市| 和平县| 锦州市| 武汉市| 屯昌县| 佳木斯市| 平昌县| 和静县| 方正县| 甘南县| 平湖市| 松原市| 济南市| 栖霞市| 泉州市| 霍山县| 分宜县| 南通市| 香港| 安宁市| 黔南| 巴彦县| 安国市| 冷水江市| 望谟县| 年辖:市辖区| 聂拉木县| 万宁市| 古田县| 星座| 凯里市| 平定县| 武功县|