HTTP2 Standard
The HTTP/2 standard is governed by RFC 9113. The key differences over HTTP/1 and HTTP/1.1 are header compression and the ability to use a single TCP connection for multiple, concurrent requests (called streams).
Flow Control
HTTP/2 has flow control in both directions, on both the connection and each stream in a connection. This is independent of TCP flow control. HTTP/2 flow control may cause performance issues:
If an endpoint cannot ensure that its peer always has available flow-control window space that is greater than the peer's bandwidth * delay product on this connection, its receive throughput will be limited by HTTP/2 flow control. This will result in degraded performance.
The default
initial window size for connections and streams is 65,535 bytes. A
receiver may send a SETTINGS_INITIAL_WINDOW_SIZE
frame to increase the window size for current
and future
streams; however, this does
not apply to the connection window. The connection window may only
be increased using a WINDOW_UPDATE
frame on the connection (stream
0).
The window size is decremented
on both a stream and the connection when sending a DATA
frame (just the body
size). After receiving a DATA
frame, the receiver sends
a WINDOW_UPDATE
frame on both the stream and connection to increment both window
sizes by the amount received.
Flow control may be disabled
by sending a SETTINGS_INITIAL_WINDOW_SIZE
frame with a
value of 2147483647
and a WINDOW_UPDATE
on the
connection (stream 0) with a value of 2147483647
, and then
maintain the window sizes when receiving DATA
frames with
subsequent WINDOW_UPDATE
frames, if needed.