Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I understand that HTTP2 aims to keep everything under a single TCP connection, and I was wondering how often TCP connections would be torn down.

For example, if I visit youtube, do some browsing, leave the site, and come back, will I be re-using the same HTTPS connection (in terms of TCP 4-tuple, NOT session), or a different one?

A lot of this is probably application-specific, and up to how the browser implements it, but is it specified anywhere in the standard?

share|improve this question
up vote 18 down vote accepted

There are only few guidelines in the relevant section 9 of the specification:

  • There should not be multiple connections from the browser to the same server
  • Connections should not be closed "until it is determined that no further communication with a server is necessary", i.e. when the tab is closed and no other tabs have communication to the server
  • The server can close idle connections at any time, but servers are encouraged to keep connections open as long as possible.

For example, if I visit YouTube, do some browsing, leave the site, and come back, will I be re-using the same HTTPS connection (in terms of TCP 4-tuple, NOT session), or a different one?

In this case chances are high that a new connection will be used, at least unless another tab has some video from YouTube embedded. But since resources at the client are usually cheaper than on the server (except maybe for mobile phones) it might be that the server will be the first one to close the idle connection in order to save resources.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.