A brief discussion on HTTP connection management

little bottle
Release: 2023-04-06 09:38:02
forward
2485 people have browsed it

The editor of this article will talk to you about HTTP connection management, which has certain learning value. Interested friends can learn about it.

HTTP connection management:

1. Misunderstood Connection header

When the http message passes through various proxy devices between the intermediate client and the server, the label in the Delete the listed header information. close means closing the connection after the transaction.

2. Eliminate the serialization delay

Parallel connection: multiple TCP connections initiated Concurrent HTTP requests

Persistent connections: reuse TCP connections, eliminating connection and closing delays

Pipeline connections: initiating concurrent HTTP requests through concurrent TCP connections

3 .Open a small number of parallel connections, each connection is a persistent connection

keep-alive in HTTP/1.0 and persistent in HTTP/1.1

The client sends Connection:keep-alive service The end response Connection: keep-alive means support, otherwise it does not support

4. HTTP/1.1 persistent connection persistent

The difference between persistent

and keep-alive is that this is open by default unless sent Connection:close explicitly closes

5. The connection will be closed at any time. Each http response should contain Content-Length to verify the integrity of the data

6. Closing the connection And retrying will bring some side effects. If the post request is retried multiple times, there will be risks.

7. Close the connection normally, there are two types: complete closure and semi-closure

Complete closure That is, the input and output of the server are all turned off. Half-closure means that only the output or input is turned off.

When data is sent to a closed connection, an error will occur that the connection was reset by the opposite end.

When closing, the output channel should be closed first, and then the input channel Related tutorials:

HTTP video tutorial######

The above is the detailed content of A brief discussion on HTTP connection management. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:cnblogs.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!