1

If a webserver serves multiple virtual hosts (which can be selected by the client in the HTTP request header Host) and supports Keep-Alive, is the client allowed to send subsequent requests over the same connection with a different Host header?

pts
  • 80,836
  • 20
  • 110
  • 183
  • 1
    It seems yes for Apache: http://stackoverflow.com/questions/35532480/is-http-keep-alive-effective-with-different-domain-on-the-same-webserver – shaochuancs Mar 13 '17 at 15:43
  • 1
    Also, @Michael Neale reports that connection is reused for different virtual hosts, on Chrome. http://stackoverflow.com/questions/4139379/http-keep-alive-in-the-modern-age – shaochuancs Mar 13 '17 at 15:47
  • @shaochuancs: Thank you for the comments! If you copy them to an answer, I'll accept it. – pts Mar 13 '17 at 16:45

1 Answers1

3

From performance/efficiency point of view, both browser and server should Keep-Alive base on IP, not Hostname. Anyway, the reused connection is on TCP level, not HTTP level.

Although no information is found in RFC2068's Persistent Connections section. It seems Apache Keep-Alive between different virtual hosts (Is http keep-alive effective with different domain on the same webserver?). Also, @Michael Neale reports that connection is reused for different virtual hosts, on Chrome.

Community
  • 1
  • 1
shaochuancs
  • 15,342
  • 3
  • 54
  • 62