Log in / create account | Login with OpenID
DocForge
Programmer's Wiki

HTTP

From DocForge

HTTP is an abbreviation for HyperText Transport Protocol. It's the primary communications protocol used between web browsers and web servers.

HTTP is a stateless protocol, meaning every request and response is independent of all others. The rendering of one web page may require many requests in addition to the main HTML, such as images and javascript. All of these requests are independent and will receive responses in an unknown order.

[edit] Keep Alive

The first HTTP implementations opened and then closed a network socket connection for each request and response. This can hurt performance when many requests are required. To get around this issue browsers and servers implemented Keep-Alive, basically an unofficial extension to the HTTP 1.0 standard.

With HTTP 1.0, a browser which supported keep-alive would send "Connection: Keep-Alive" with the request header. A server also supporting it would send "Connection: Keep-Alive" with the response header. With both the browser and server in agreement the connection between the two is kept open. At an unspecified time the browser or server may close the connection.

With HTTP 1.1, all connections are kept alive by default, but without any guarantees. A connection may still close at any time. To intentionally request a connection be closed a header can contain "Connection: close".

[edit] See Also