0

What I read everywhere is http is a text based and http/2 is a binary based protocol. Lots of articles online suggests that http/2 binary protocol is more compact and efficient to process.

Where exactly in the http work flow , text based protocol is adding the overhead ? At the application layer, we would always need to serialize the data (text) into binary anyway to transfer on the wire. So, essentially are we not transferring the data in a binary using both http/http2 ?

Where exactly binary protocol in http2 work flow is bringing in that compactness and processing efficiency

M. Shashanka
  • 39
  • 1
  • 8
  • Does this answer your question? [Why is it said that HTTP2 is a binary protocol?](https://stackoverflow.com/questions/58498116/why-is-it-said-that-http2-is-a-binary-protocol) – Barry Pollard Sep 27 '20 at 13:13

1 Answers1

0

At the application layer, we would always need to serialize the data (text) into binary anyway to transfer on the wire.

True, but till HTTP/1, data was written to the underneath layer like tcp layer in text. But in Http/2 the data is encoded into binary packed into frames and sent to the underlying layer.

Text format cannot fit exactly into the fixed sized frames. A character may get split across multiple frames. Rather binary encoding the data and splitting it into multiple frames looks more preferable.
Prasanna
  • 2,390
  • 10
  • 11