logoalt Hacker News

hnav • today at 8:11 PM • 0 replies • view on HN

It's mostly the property of servers and clients that you interoperate with that don't speak H/2. There are other situations too like if you run a CDN and you're doing sendfile with kernel TLS, you can do stuff like the below

  sock.write('HTTP/1.1 200 OK\r\ncontent-length: ' + f.size() + '\r\n\r\n')
  sendfile(sock, f)
which wouldn't work with H2/H3. WebSockets are still in practice H/1 only (spec exists but is disabled in browsers). Another aspect is that if you're simply using HTTP as a preamble to 1 large (bidi) pipe, the extra framing and flow control of H/2 is just a performance handicap.