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

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.

主站蜘蛛池模板: 台北市| 繁昌县| 信阳市| 林口县| 寻甸| 始兴县| 武强县| 绥滨县| 仁布县| 华蓥市| 新平| 颍上县| 东方市| 伽师县| 阳曲县| 泽州县| 社旗县| 盈江县| 永清县| 福清市| 荣成市| 大庆市| 武汉市| 麻栗坡县| 云阳县| 资中县| 河池市| 阳江市| 辰溪县| 安岳县| 巫溪县| 邹平县| 安徽省| 常州市| 栾城县| 正安县| 兴仁县| 抚州市| 包头市| 邢台市| 翁源县|