What happened during the loading process from the URL input to the page?

Source: Internet
Author: User
1) divide the URL into several parts: Protocol, network address, and resource path. The Network Address indicates which computer is connected to the network, which can be a domain name or IP address, which can include a port number. The protocol is used to obtain resources from the computer. The common protocol is HTTP and FTP, different protocols have different communication content formats. The resource path indicates which resource is obtained from the server.
Example: http://www.guokr.com/question/554991/
Protocol section: HTTP
Network Address: www.guokr.com
Path:/question/554991/

2) if the address is not an IP address, resolve it to an IP address through DNS (Domain Name System. The IP address corresponds to a computer on the network, and the DNS server itself also has an IP address. Your network settings include the IP address of the DNS server.
For example, www.guokr.com is not an IP address. Ask the DNS for the IP address corresponding to www.guokr.com and obtain the IP address 111.13.57.142. In this process, if the DNS server directly asked by your computer does not have the IP address corresponding to www.guokr.com, it will ask its higher-level server. The higher-level server may not, you can find the root node at most or not at all.

3) if the address does not contain the port number, determine one according to the default port number of the Protocol. The port number is for a computer, just like a window number for a bank. A bank has multiple windows and each window has a number. Different windows can be used for different services. A port is just a logical concept and has nothing to do with computer hardware.
For example, www.guokr.com does not contain the port number. The default port number of HTTP protocol is 80. If the URL you entered is http://www.guokr.com: 8080/, it means that the specified port number 8080 is used instead of the default port number.

4) Initiate a network connection to the IP address and port number identified by 2 and 3.
For example, initiate a connection to port 80 of 111.13.57.142.

5) Organize a request packet according to the HTTP protocol requirements, which contains a large amount of request information, including the requested resource path and your identity
For example, to express this packet in a natural language, it is probably the request/question/554991/, and my identity is XXXXXXX.

6) The server responds to the request and returns the data to the browser. The data may be a webpage organized according to the HTML protocol, which contains the layout and text of the page. Data may also be images, script programs, etc. Now you can use the browser's "view source code" function to feel what the server returns. If the resource indicated by the resource path does not exist, the server returns the famous 404 error.

7) if (6) a page is returned, obtain it again based on the URL of some external links and the address of the sample slice according to (1)-(6.

8) organize resources into images displayed on the screen based on the resource type. This process is called rendering. Web page rendering is the most complex and core function of the browser.

9) display the rendered page image and start responding to user operations.

The preceding steps are the most basic steps. They are not described in some optional steps, such as webpage cache, connection pool, loading policy, encryption and decryption, and proxy transfer. Even though the basic steps are complicated, TCP/IP, DNS, HTTP, and HTML can be a huge topic, the basics of browsers-operating systems, compilers, and hardware-are even more complex. It is not normal for a computer professional to understand the above explanation. I may ask why it is so complicated, however, I promise that every step is well thought out and tested by time. You can enter a URL to browse the Internet, and the computer system has done countless jobs that you cannot see behind it. Countless engineers in various computer fields have made unimaginable efforts.

6 discussions

 

26 2

Leptc physics, double Bachelor of mathematics, computing physics, focus on selling Meng

Supporter: buttons, a huge mountain and nddtl Abay more

Press F12 to open the console, select the check boxes under "network", and refresh the page to view the complete log of the loading process...



The first line is to find the shell server. CSS is used to load style sheets, and IMG is used to load images ,. javascript loads JavaScript scripts, and there are many more at the end. Let's play with it by yourself...

Sometimes you can see some additional information, such...



The above is a developer tool provided by the browser, and a tool for analyzing network data packets, but I forgot my name...

 

Original post address: http://www.guokr.com/question/554991/

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.