HTTP is statel-less,so what does it mean by keep-alive?

前端 未结 5 1951
慢半拍i
慢半拍i 2021-02-07 10:49
Keep-Alive: 300
Proxy-Connection: keep-alive

As we know HTTP connection is closed when the request gets responded,so what does it mean by keep-al

5条回答
  •  深忆病人
    2021-02-07 11:21

    This question is already answered and accepted, but I would like to explain in details:

    Keep-alive cannot maintain one connection forever; the application running in the server determines the limit with which to keep the connection alive for, and in most cases you can configure this limit.

    In HTTP/1.1, Keep-alive is used by default. If clients have additional requests, they will use the same connection for them.

    The term stateless doesn't mean that the server has no ability to keep a connection. It simply means that the server doesn't recognize any relationships between any two requests.

提交回复
热议问题