1. What happens from the input of the URL to the display of the page
(1) Cache query (query priority: browser cache, system cache, router cache)
(2) DNS resolution, the URL to resolve the only IP [URL is to facilitate the memory].
(3) Perform tcp handshake three times, establish http link
(4) Browser gets the returned data and renders the page.
(5) Disconnect the tcp connection
Difference with ajax
(1) ajax based on the xhr object to initiate asynchronous requests, the structure is not clear
(2) fetch based on the ajax package and promise to achieve asynchronous request , code is simple , is a global window method , built-in API
(Transmission Control Protocol) and udp (User Datagram Protocol) differences
(1) tcp-oriented connection, before sending data need to establish a connection, udp-oriented datagrams, do not establish a connection to directly send data
(2) Therefore, tcp is more reliable, udp in order to achieve high delivery, does not guarantee the order of data integrity and reliability.
(3) tcp requires connection management, error detection, so the overhead is large, the transmission speed is relatively slow, udp does not need to connect and error detection, overhead is small, speed
seven layer model (OSI)
Physical Layer - Data Link Layer - Network Layer - Transport Layer - Session Layer - Representation Layer - Application Layer
Difference with post
(1) get request parameters directly spliced after the url (information is leaked), post request in the request body.
(2) Relative to the post request, get request is not safe, the speed is faster.
(3) get request is used to request data, post request users to submit forms
(4) get can be directly cached, if you need to cache post, you need to set cache-control and expiration time expired in the request header.
6. http2 and differences, advantages and features?
(1) Use text format to transmit data, http2 uses binary format, binary format parsing is more efficient, so http2 transmission rate is higher.
(2) http2 uses header compression technology to reduce the request header and the corresponding header data, reducing the burden on the network (network bandwidth).
(3) http2 adds flow control to prevent network congestion and resource waste.
Difference with https?
(1) Hypertext Transfer Protocol (http), a standard (tcp) for transmitting hypertext between the ends of a network, where the client requests a response from the server, in clear text.
(2) Secure Hypertext Transfer Protocol (https), as the name suggests, is a secure version of http, http under the addition of SSL, encrypted transmission.
(3) The default port is different 80 443.
(4) Less consumption of http resources.
(5)https need ca certificate, ca certificate charge.