First, HTTP
HTTP (Hypertext Transfer Protocol, hypertext Transfer Protocol) is an application-level protocol that is currently widely used in the Internet.
It is designed for communication between Web browsers and Web servers, but it can also be used for other purposes. HTTP follows the classic client-server model
, the client opens a connection to make the request, and then waits for it to receive the server-side response. HTTP is
A stateless protocol means that the server does not retain any data (state) between two requests.
Second, http1.0--build scalability
HTTP legacy applications are very limited, and browsers and servers are rapidly expanding to make them more versatile:
The version information is now sent with each request (HTTP1.0 is appended to the Get line)
The status code line is also sent at the beginning of the response, allowing the browser itself to understand the success or failure of the request and adjust its behavior accordingly (such as updating in a specific way or using a local cache)
Introduces the concept of HTTP headers, whether for a request or a response, allowing metadata to be transferred and making the protocol very flexible and extensible.
With the help of the new HTTP header, the ability to transfer other types of documents except plain text HTML files has been added. (thank Content-type Head).
It also begins to support an keep-alive
early experimental persistent connection called a connection that shows some of the performance benefits of the keep-alive connection, which compares the timeline for implementing 4 HTTP transactions on a serial connection with the timelines required to implement the same transaction on a persistent connection. Time has been shortened because of the overhead of connecting and closing connections.
A request header must be sent connection:Keep-Alive
to activate the keep-alive
connection
Iii. Agreement on http1.1--standardization
Http/1.0 's many different implementations are confusing, HTTP1.1 is the first standardized version, with a focus on correcting structural flaws in the HTTP design:
The connection can be reused, saving time to open it multiple times to display resources embedded in a single original document.
Increases pipelining to allow a second request to be sent before the first answer is completely sent to reduce the latency of the communication.
Support for response chunking.
Introduction of additional cache control mechanisms.
Introduce content negotiation, including language, encoding, or type, and allow client and server contracts to be exchanged with the most appropriate content.
Thanks to the Host header, it is possible to have different domain names configured on the same IP address of the server.
Security has been improved
In http1.1, both the client and server are the default side support long links, if you do not want to use long links, you need to specify the connection:close in the header;
Iv. http2.0--for superior performance
HTTP/2 has several basic differences in http/1.1:
- HTTP2 is a binary protocol rather than a text protocol. No longer readable and barrier-free manual creation, improved optimization techniques can now be implemented.
- This is a multiplexing protocol. Parallel requests can be processed in the same link, removing the order and blocking constraints in the http/1.x.
- Compressed the headers. Because headers is often similar in a series of requests, it removes the cost of duplicating and transmitting duplicate data.
- It allows the server to populate the client cache with data and request it in advance through a mechanism called server push.
Five, HTTPS
The data transmitted by the HTTP protocol is unencrypted, which is plaintext, so it is very insecure to use the HTTP protocol to transmit private information. To ensure that these private data can be encrypted, Netscape designed the SSL (Secure Sockets Layer) protocol to encrypt the data transmitted by the HTTP protocol, which led to the birth of HTTPS. HTTPS is now used by the TLS protocol, but because SSL appears earlier, and is still supported by the browser now, so SSL is still synonymous with HTTPS.
HTTPS requires a handshake between the client (browser) and the server (Web site) before transmitting the data, which establishes the password information for both parties to encrypt the transmitted data during the handshake. The TLS/SSL protocol is not just a set of protocols for encrypted transmissions, asymmetric encryption, symmetric encryption, and hash algorithms are used in TLS/SSL.
HTTP, HTTP1.0, HTTP1.1, HTTP2.0, HTTPS