Let’s briefly review this classic process from the perspective of performance optimization: First we need to use DNS (domain name resolution System) to resolve the URL to the corresponding IP address, and then we establish a TCP connection with the IP address of the server, and then we throw our HTTP request to the server, and after the server processes our request, The target data is returned to the client in an HTTP response, and the browser that receives the response data can begin a rendering process. Once rendered, the page is presented to the user, waiting for a response (as shown below).

We split this process into the following process fragments: A. DNS resolution B. TCP connection C. HTTP request throwing D. The server processes the request and returns the HTTP response. E. The browser retrieves the response data, parses the response, and displays the parsed result to the userCopy the code

We keep in mind that any of our clients’ products need to take these 5 processes into account in their own performance optimization scheme, repeatedly weighing, so as to polish the speed of user satisfaction.

Optimization at the network level: DNS parsing takes time, minimize the number of parsing times or prefetch, use the browser DNS cache and DNS prefetch. TCP three-way handshake how to optimize, long link, pre-link, access SPDY protocol. HTTP request, reduce the number of requests and request volume. The farther away the server is, the slower a request is, and the static resources are placed on the CDN closer to us. Browser side optimization: resource loading optimization server side optimization browser cache mechanism using DOM tree to build web page typesetting and rendering process reflux and redraw considerations DOM operation reasonable avoidance......Copy the code