Keep-Alive (also called HTTP persistent connection or HTTP keep-alive) is a web server setting that allows you to set the type of connection between a web server and a web browser.
When a website is accessed, the web browser connects to the web server over the Internet using network protocols (TCP / IP). Each TCP network connection is a communication channel through which a web browser and a web server exchange HTTP requests and HTTP responses.
By default, a web page is a collection of many separate resources such as images (.jpg, .png…), style (.css), interactivity (.js…) documents (.doc, .pdf…), multimedia (.flv, .mp3 ) and other.
These objects are separate from the HTML code of the web page itself and do not even have to be on the same server. In reality, only pointers are placed in the HTML code through which these resources are called. After receiving the HTML code of the web page, the web browser reads the directories and sends to the web server one HTTP request for each resource.
When Keep-Alive is not used, a separate communication channel (TCP connection) will be created between the web server and the web browser for each individual HTTP request. After the web server provides an HTTP response to the HTTP request, the connection is terminated. At the next request from the web browser, the web server will open a new communication channel. To the loading time of the web page is added the time to create and terminate each TCP connection. When there are more objects, it significantly slows down the final loading of the web page.
When Keep-Alive is used, the communication channel (TCP connection) between the web browser and the web server is not terminated after only one HTTP request / response. Instead, the connection remains open and multiple HTTP requests / responses are transmitted over it. The connection is terminated when there are no more requests from the web browser.
With a persistent communication channel, the web browser can request multiple resources from the server and receive them on the same channel. This eliminates the extra time spent creating and disconnecting multiple connections to the web server, and loading web pages is significantly faster.
In version 1.1 of the HTTP protocol, Keep-Alive is described as the default method for the connection between a web server and a web browser.
Information about the connection method is given in the header of the HTTP request and the HTTP response.
HTTP/1.1 200 OK
Date: Mon, 19 Jan 2015 12:14:41 GMT
Keep-Alive: timeout=5, max=5
Content-Type: text/html; charset=UTF-8
Two parameters can be set in the Keep-Alive web server settings:
timeout – after how much time of inactivity on the communication channel, to terminate the connection; in seconds; if no new HTTP request is received on the channel, the connection is terminated;
max – maximum number of applications that can be submitted per communication channel.
Disconnection can be triggered either by the web browser or the web server by submitting Connection: close in the headers of the last request / response.
To check if Keep-Alive is enabled on the web server, look at the HTTP headers of its HTTP response.
You can view HTTP headers sent from the web server either through a web browser, using a developer tool, or through an online tool such as: https://www.dnsqueries.com/en/googlebot_simulator.php (Enter the website address in the WebPage field) Keep-Alive is enabled if the HTTP response contains Connection: Keep-Alive.
Finden Sie nicht die Informationen, die Sie suchen?