The eight basic steps, and then you go through them

  1. Resolving URL Addresses
  2. DNS resolution point to view here
  3. TCP links (three-way handshake) click here to view
  4. Sending an HTTP request
  5. The server receives the request
  6. Server response
  7. TCP link disconnects (four times waved) point this view
  8. Browser parsing resources

Sending an HTTP request

HTTP protocol is based on TCP/IP protocol, TCP to ensure that the connection is smooth, HTTP can be normal requests and responses. First, HTTP requests are stateless and can only be initiated by the browser and responded by the server. The browser sends a request packet carrying the following information

  • Request path
  • Query parameters
  • Request method
  • Request header
  • Request body

The server accepts requests and responses

The server accepts the request, parses the information, and selects the appropriate logic to process it (for example: find the corresponding static page, save the file, operate the database, forward….). And returns the processing result to the browser. The response generally consists of the following parts

  • Status code
  • State the text
  • Response headers
  • Response body

Browser parsing resources

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 finish. These include the following steps:

  1. Parse the HTML and build the DOM tree
  2. Parses the CSS and generates the CSS rule tree
  3. Combine DOM tree and CSS rules to generate Render tree
  4. Render the Render tree (paint), which draws the page pixel information
  5. According to