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

HTTPS can be significantly faster than HTTP

Some technologies designed to make websites faster only work with HTTPS. One example is a protocol enhancement known as HTTP/2. Take the HTTP versus HTTPS test to see this in action (see https://www.httpvshttps.com/ for details).

When I first saw research showing HTTPS to be faster, I admit I was skeptical. I saw how much time the encryption adds in network waterfalls. Fortunately, the folks managing browsers and network stacks have done us a solid and smoothed out many of the issues that cause SSL to be slower than non-SSL, as illustrated in the following quote from Adam Langley at Google:

"On our production frontend machines, SSL/TLS accounts for less than 1% of the CPU load, less than 10 KB of memory per connection and less than 2% of network overhead. Many people believe that SSL/TLS takes a lot of CPU time and we hope the preceding numbers will help to dispel that."

Because HTTP/2 multiplexes requests through a single connection, there is only one TLS handshake that must be completed. This reduces the time to retrieve assets and server load. Now the client and the server only need to perform a single handshake and encryption cycle.

The goal of HTTP/2 is to improve performance by undoing the shortcomings of the HTTP/1.1 specification. HTTP/2 eliminates connections by multiplexing responses, compressing headers, prioritizing responses, and allowing server-side push, as shown in the following image:

All browsers support HTTP/2 and most servers do as well. Windows 2016 was the last major operating system to ship HTTP/2 support. Since it is relatively new, there are not many production deployments online.

HTTP/2 does not change any of the HTTP semantics. Status codes, verbs, and other such phrases are things we have used for years, and thus will not break existing applications.

The de facto implementation that standard browsers are enforcing is HTTP/2 over TLS. While you could technically use HTTP/2 without TLS, browsers do not allow this approach.

The combination of the single connection and TLS handshake in concert with the other performance benefits that HTTP/2 offers mean that TLS is consistently faster than HTTP.

主站蜘蛛池模板: 西乌珠穆沁旗| 蒙山县| 徐闻县| 榆树市| 大悟县| 响水县| 临猗县| 舟山市| 黄大仙区| 古田县| 大荔县| 长春市| 峨边| 六枝特区| 久治县| 平泉县| 辛集市| 图木舒克市| 翁牛特旗| 叶城县| 泰安市| 皮山县| 出国| 新巴尔虎右旗| 汾阳市| 景东| 从江县| 牡丹江市| 晋江市| 永胜县| 韩城市| 绥德县| 彭山县| 太湖县| 泗阳县| 道孚县| 广昌县| 芒康县| 湘潭县| 泗洪县| 陈巴尔虎旗|