Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Why keep aive connection  RSS feed

 
jawwad ahmed
Ranch Hand
Posts: 179
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
p>
<br>Http is state less protocol than when i print
<br>System.out.println(request.getHeader("connection"));
<br>It prints keep-alive.
<br>Can any body tell reason
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The initial browser request downloads the web page, then a separate request must be sent for each page element (images, movies etc).
If the connection is closed, the client and server would have to re-negotiate a new HTTP connection for each of these items.
I believe the "keep-alive" allows it to ask for each image without the handshaking overhead for each one.
Dave.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!