HTTP vs HTTPS performance

后端 未结 22 2009
说谎
说谎 2020-11-22 10:30

Are there any major differences in performance between http and https? I seem to recall reading that HTTPS can be a fifth as fast as HTTP. Is this valid with the current g

22条回答
  •  情深已故
    2020-11-22 10:35

    Browsers can accept HTTP/1.1 protocol with either HTTP or HTTPS, yet browsers can only handle HTTP/2.0 protocol with HTTPS. The protocol differences from HTTP/1.1 to HTTP/2.0 make HTTP/2.0, on average, 4-5 times faster than HTTP/1.1. Also, of sites that implement HTTPS, most do so over the HTTP/2.0 protocol. Therefore, HTTPS is almost always going to be faster than HTTP simply due to the different protocol it generally uses. However, if HTTP over HTTP/1.1 is compared with HTTPS over HTTP/1.1, then HTTP is slightly faster, on average, than HTTPS.

    Here are some comparisons I ran using Chrome (Ver. 64):

    HTTPS over HTTP/1.1:

    • 0.47 seconds average page load time
    • 0.05 seconds slower than HTTP over HTTP/1.1
    • 0.37 seconds slower than HTTPS over HTTP/2.0

    HTTP over HTTP/1.1

    • 0.42 seconds average page load time
    • 0.05 seconds faster than HTTPS over HTTP/1.1
    • 0.32 seconds slower than HTTPS over HTTP/2.0

    HTTPS over HTTP/2.0

    • 0.10 seconds average load time
    • 0.32 seconds faster than HTTP over HTTP/1.1
    • 0.37 seconds faster than HTTPS over HTTPS/1.1

提交回复
热议问题