Hypertext Transfer Protocol (HTTP) Question:
Download Questions PDF

What is Persistent connections?

Answers:

Answer #1
In HTTP/0.9 and 1.0, the connection is closed after a single request/response pair. In HTTP/1.1 a keep-alive-mechanism was introduced, where a connection could be reused for more than one request.

Answer #2
Keep-alive is for HTTP1.0. In HTTP1.1, it is called "persistent" in header. In HTTP1.0, connections are by default non persistent. so client need to indicate in each request that it wants keep using this connection, by specifying a "keep-alive" in the request header. Then the server can decide to close or keep using it. If the server response header does not contain "keep-alive", the connection will be closed (even though the client wanted to be re-used). There are also mechanism to automatically close a connection, by specifying additional headers such as "max=N, time=nnn". Unlike HTTP/1.0+ keep-alive connections, HTTP/1.1 persistentconnections are active by default. HTTP/1.1 assumesall connections are persistent unless otherwiseindicated. HTTP/1.1 applications have to explicitly add a Connection:close header to a mess

Download HTTP Interview Questions And Answers PDF

Previous QuestionNext Question
What is Status codes?What is HTTP session state?