Rohit Bajaj
asked on
what significance has Connection :"keep-alive" in response headers
HI,
In a web application i saw the following in response headers :
Connection :"keep-alive"
I want to mimic it and thinking of adding the following to my spring mvc code :
response.setHeader("Connec tion", "keep-alive");
Does it make any difference whether i pass that in header or not ?
What does it mean ?
Thanks
In a web application i saw the following in response headers :
Connection :"keep-alive"
I want to mimic it and thinking of adding the following to my spring mvc code :
response.setHeader("Connec
Does it make any difference whether i pass that in header or not ?
What does it mean ?
Thanks
ASKER
hi
so it makes sense to send back keep alive in response only if the request has keep alive ?
its like if the client has sent keep alive then it means it supports persistent connection and when we send it in response then a kind of approval is send which forces client to keep the connection open ?
is it possible to see it happenning in some open source browser code , just to get more familiar with concept?
so it makes sense to send back keep alive in response only if the request has keep alive ?
its like if the client has sent keep alive then it means it supports persistent connection and when we send it in response then a kind of approval is send which forces client to keep the connection open ?
is it possible to see it happenning in some open source browser code , just to get more familiar with concept?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
The communication socket keeps alive for multiple requests
The common behavior is one connection-request-respons
When you send this header, the client (only if supports keep-alive) tries to keep sending request using sonly one connection until the connection is closed,
See more details:
https://en.wikipedia.org/wiki/HTTP_persistent_connection