How does HTTP2 solve Head of Line blocking (HOL) issue

后端 未结 2 1360
北海茫月
北海茫月 2021-01-30 04:32

How does HTTP2 solve Head of Line blocking (HOL) issue?

This problem is very frequent in http1.1, but I heard HTTP2 has fixed this problem. Could someone explain how ex

2条回答
  •  野的像风
    2021-01-30 05:07

    HTTP Head of line blocking

    Head of Line blocking in HTTP terms is often referring to the fact that each browser/client has a limited number of connections to a server and doing a new request over one of those connections has to wait for the ones before to complete before it can fire it off.

    The head of line requests block the subsequent ones.

    HTTP/2 solves this by introducing multiplexing so that you can issue new requests over the same connection without having to wait for the previous ones to complete.

    In theory, the pipelining of HTTP/1.1 also offered a way around HOL, but it was tricky and very error-prone to implement in practice. That has made it not get widely enabled on the web even up till today.

    TCP Head of line blocking

    HTTP/2 does however still suffer from another kind of HOL, namely on the TCP level. One lost packet in the TCP stream makes all streams wait until that packet is re-transmitted and received. This HOL is being addressed with the QUIC protocol...

    QUIC is a "TCP-like" protocol implemented over UDP where each stream is independent so that a lost packet only halts the particular stream to which the lost packet belongs, while the other streams can go on.

    HTTP/3 is being done over QUIC instead of TCP and TLS.

提交回复
热议问题