当前位置:网站首页>Please describe the whole process from entering a URL in the browser to rendering the page.

Please describe the whole process from entering a URL in the browser to rendering the page.

2022-06-22 20:02:00 51CTO

I believe many front-end programmers have encountered this problem during the interview , The first time I encountered this problem, I was ignorant , I was unprepared to talk nonsense , Naturally, the interview is cold , I have learned this piece recently , Make a record here ~

Overall process :

 Please describe how to enter a from the browser url To the whole process of rendering the page ._web The server

  1. If URL Contains domain names , The browser connects to DNS( Domain name server ), Find the domain name IP Address ;
  2. web The browser connects to the corresponding web The server , issue http request , What you want ;(TCP Three handshakes )
  3. web The server checks whether the requested resource exists , To be is to return , Returns if it does not exist 404;
  4. web The browser receives the resource and closes the connection ;(TCP Four waves )
  5. The browser parses the entire page , And check for other resources needed , Such as the picture ;
  6. Keep sending out http request , Request corresponding resources ;
  7. All resources requested , The page is completely displayed . 

Key content

DNS:Domain Name Service Domain name service , Resolve the domain name to ip, This process involves CDN, I will learn in detail later CDN.

TCP/IP Overall process of the agreement :

 Please describe how to enter a from the browser url To the whole process of rendering the page ._ Applications _02

application layer : Application specific protocols , Such as WWW、 E-mail 、FTP etc. . 

TCP Transport control layer :Transmission Control Protocol Transport control layer protocol ,TCP It's connection-oriented , Reliable byte stream transport service .TCP Use the port number to direct packets to a specific application on the computer .

IP The network layer :Internet Protocol Network layer protocol ,IP It's an unreliable , No connection protocol .IP Pass the packet through IP Address transfer to the specified computer .

Hardware layer : Convert binary data into photoelectric signals .




原网站

版权声明
本文为[51CTO]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/173/202206221832391303.html