Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You just described http2


Wait, with http2 a webbrowser never closes the connection it has to a webserver?


Even HTTP/1.1 from 1999 keeps a persistent connection open, if the client and server agree.

What it doesn't do so well is lots of parallel requests and responses out of order. HTTP/2 is better for that.

Both versions will close the connection if it's been idle for a while, and automatically reconnect as needed.


Yes, it's a long-lived TCP connection. It's not mandatory but the whole point of the protocol is to make one connection and send/receive all your assets over it instead of making more connections (which take time to setup and slow down page rendering).


It keeps it open as long as it is used and usually a bit past that. So if you have any traffic or are making periodic requests then it won't close the connection. If you are using SSE that can also use the same shared connection for streaming realtime updates to the client.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: