What happened to the page from entering the URL to the completion of the page loading display

  1. The browser will open a thread to process the request, and analyze and judge the URL according to the Web method if it is the http protocol;

  2. Call the corresponding method in the browser kernel, such as the loadUrl method in WebView;

      3. Obtain the IP address of the website through DNS resolution, set the UA and other information to send a second GET request;

  4. Conduct an HTTP protocol session, and the client sends a header (request header);

      5. Enter the Web Server on the web server, such as Apache, Tomcat, Node.JS and other servers;

      6. Enter the deployed back-end applications, such as PHP, Java, JavaScript, Python, etc., to find the corresponding request processing;

  7. The processing end returns the header. If the browser has accessed it and there is a corresponding resource in the cache, it will be compared with the last modification time of the server. If it is consistent, it will return 304;

      8. The browser starts to download the html document (response header, status code 200), and uses the cache at the same time;

      9. The document tree is established, and the MIME type of file (such as css, js) is specified according to the tag request, and the cookie is set at the same time;

      10. The page starts to render the DOM, JS operates the DOM according to the DOM API, performs event binding, etc., and the page display is completed.

 

In short:

  The browser submits the requested URL to DNS domain name resolution, finds the real IP, and initiates a request to the server;

  The server returns the data after the background processing is completed, and the browser receives the files (HTML, JS, CSS, images, etc.);

  The browser parses the loaded resources (HTML, JS, CSS, etc.), and establishes the corresponding internal data structure (such as HTML DOM);

  Load the parsed resource file, render the page, and complete.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326712684&siteId=291194637