4 ms·
Considering the best practice for HTTP/1.1 is to create few very large files - why would compressing headers really make a difference?
by Illniyar 12y ago
Considering the best practice for HTTP/1.1 is to create few very large files - why would compressing headers really make a difference?
- sp332 12y ago"Best practice" can take a lot of work and often doesn't happen in real life. HTTP/2 gets you this advantage for free.
- rakoo 12y agoHTTP/2.0 does not only compress headers, it also keeps a context of headers that were already sent. So if you want to include a specific header with the same value in multiple requests (like, say, a cookie), it won't actually be re-sent on the wire. The other side will know that the value hasn't changed.
- MichaelGG 12y agoIf the headers are big enough, then you may need multiple packets to transmit the request. Also, some TCP stacks (or an extension option?) will allow data in the first packet, so you don't have to wait for the handshake. Perhaps this doesn't work if the data doesn't fit in a single packet?
- michaelmior 12y agoAside from the other responses to this comments, this goes towards making HTTP2 requests cheap which enables a lot of other optimizations that were antipatterns under HTTP/1.1