Request Header Setting: Connection

By default, ConnectionHeader is installed on Keep-Alivebrowsers so that you can open the connection for further requests from the browser.

When I make a headline Connectionon close, what could be the difference? Will this affect any performance issue?

(one addition: I set the header from xmlhttprequest)

+5
source share
2 answers

When you make requests with " Connection: keep-alive ", a subsequent request to the server will use the same TCP connection. This is called a persistent HTTP connection. This helps reduce server-side processor load and improves latency / response time.

If the request is made using Connection: close , this means that after the request has been completed, the server needs to close the connection. Thus, a new TCP connection will be established for each request.

By default, the HTTP 1.1 client / server uses keep-alive, while the HTTP 1.0 client / server does not support keep-alive by default.

+10
source

, . .

0

All Articles