It happened after entering the URL of pressing the enter key

What browser and enter the URL of the server after pressing the enter key to their occurrence.

Browser

1. The user enters a URL in the browser address

2. The browser parses the user enters the URL = "domain name + port

The existence of this domain name = "IP 3. browser checks the local cache

4. If not initiate a DNS system call => IP (already found IP)

4.1 DNS system calls

       4.1.1 Check the operating system does not have this domain

        4.1.2 Check the hosts file has no domain name

        4.1.3 initiates a call until you find the DNS domain name = "IP

The browser will be a connection between the port specified by the local port and the creation of a random server

6. Information browser client will make a package

7 browser will send the packet to the server through the established connection channel

The next stage server, apache server to server as an example

1. Open the packet sent by the client, the request path to get inside

2. Locate the file name under which the request to expand the path to a file type MIME TYTPE

3. To determine whether the file type is a static file

4. If a static file directly read the contents of the file

5. If it is not a static document determines what program can handle this type of file, to the program for processing, program processing results back to the server-side

6. The server-side to make a package file

7. Prior to the server through the connection channel packet back to the client

Followed by another browser on the server returns the packet processing

8. Open the server returns the packet to find the Content-type

Content-Type is determined according to treatment response content

10. If it is to render the HTML page

 

Guess you like

Origin www.cnblogs.com/wybim/p/12013751.html