3 ms·
Wait, with http2 a webbrowser never closes the connection it has to a webserver?
by Asmod4n 6y ago
Wait, with http2 a webbrowser never closes the connection it has to a webserver?
- qbasic_forever 6y agoYes, 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).
- SahAssar 6y agoIt 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.
- jlokier 6y agoEven 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.