What are the benefits of HTTP caching?

Caching is a technique for saving a copy of a resource and using it directly on the next request. When the Web cache discovers that the requested resource has been stored, it intercepts the request and returns a copy of the resource rather than going to the source server to download it again. The benefits include reduced server-side stress and improved performance (less time to acquire resources).

The difference between HTTP and HTTPS?

HTTP uses plaintext transmission without encryption and uses port 80. HTTPS is also HTTP and uses TLS/SSL encryption. SSL workflow: 1. Negotiation of encryption algorithm 2. Server authentication 3. Session key calculation 4. Secure data transmission

What is TCP, a handshake and a wave?

Transport layer transmission control protocol, connection-oriented, has two endpoints, connects over Socker, reliable delivery, full duplex communication, byte stream oriented. Pay attention to synchronization bit and confirmation position 1, serial number, confirmation number, AB Status change: three-message handshake:


Four wave release:



After the second wave, the TCP connection is in half-dosed state, and USER B can transmit data to user A

Is HTTP long or short?

Http1.0:1. The header sent by the client contains a “Connection: keep-alive” request. 2. After receiving the request for a long Connection, the server adds “Connection: keep-alive” to the response header and does not close the Connection. 3. After receiving the response from the server, the client finds Connection: keep-alive and does not close the Connection. Use this connection to send the request again. 4. Go to the first step, loop http1.1:1. The client sends http1.1 directly, the server automatically determines that the Connection is long, add “Connection: keep-alive” to the header in response, and do not close the Connection. 2. The client finds Connection: keep-alive in the header in response and continues to send the request using this Connection. 4. Go to step 1 and loop

How to implement server push?

This technique leaves all the work to the server. The server constantly runs applications associated with dynamic documents, regularly updates information, and sends updated documents.

TCP/UDP/HTTP to distinguish?

UDP user datagram protocol: 1. No connection 2. Unreliable connection, best delivery 3. TCP transmission control protocol: 1. Connection-oriented 2. 1. HTTP is the application layer above the transport layer. TCP and UDP are both at the transport layer. 2

HTTP status code?

The serial number meaning instructions
1xx Notice the information Indicates that the request was received or is being processed
2xx successful To show acceptance or knowledge
3xx redirect Indicates that necessary action is required to complete the request
4xx Client error Syntax error, cannot complete
5xx Server error Indicates server failure.

Packet capture tool, how to capture packet HTTPS?

Charles disguised himself as CA. Charles signed a public key through his CA and sent it to the client. The client mistakenly thought it was the server, so that the subsequent processes would go to Charles first and then to the target server.

TCP sliding window?

Function: Ensure reliable transmission 1. A->B sends A packet, and B returns the number of bytes in the window and the confirmation number. 2. A can generate the next window value size window, and B’s target window is the confirmation number. A resends the window, and B returns the highest digit to confirm the serial number. 3. User A confirms the highest serial number and moves forward according to the confirmation number, so does User B.


TCP with UDP?

1. Add handshake waving process, add SEQ/ACK mechanism 2. Increase the sending and receiving cache 3. The timeout retransmission mechanism

What if HTTPS public key is exposed?

Public keys are exposed, private keys are preserved. Nowadays, the RSA non-heaped algorithm is generally used and the private key is not exposed.

How to ensure correct uploading of files in HTTP sections?

Segmentation is a breakpoint continuation. Enhanced validation, such as implementing last-Modified to indicate when a file was Last Modified, or using the ETag header to place a unique identifier for the file.

What layers do computer networks have and what protocols do they correspond to?

OSI seven layers, TCP four layers, computer network five layers


What data does IP/TCP transfer?

IP transport layer TCP and UDP data HTTP, SMTP, FTP, and DNS data at the TCP transport layer

What is DNS and what does it do?

Domain name system, which resolves IP addresses from domain names

Symmetric/asymmetric encryption?

Symmetric: The two sides use the same key, for example, AES. Asymmetric: The two sides have different keys. One public key and one private key should be kept well. For example, RSA