当前位置:网站首页>The process of browser accessing the website
The process of browser accessing the website
2022-07-03 04:49:00 【A rookie who has been studying hard】
The process of browser accessing the website :
1、DNS analysis :
(1) Why DNS analysis ?
Domain name resolution is to point the domain name to the website space IP, Let people through the registered domain name can easily access a website service . For websites , After the process of domain name resolution , Netizens can easily and conveniently visit the website through this domain name . If it is not parsed , The domain name cannot be used normally .
(2) System cache query
(3) Router cache 、ISP cache
(4)DNS recursive query
2、TCP Connect :
(1) Three handshakes
(2) Four breakups
3、HTTP request :
Once complete http Request processing :
(1) Establishing a connection : Receive or reject connection requests
(2) Receiving request : The process of receiving a request for a resource in a client request message
(3) Processing requests : The server parses the request message , And obtain the requested resource and request method and other related information , According to the method , resources , The header and optional body parts handle the request
Common requests Method: GET、POST、HEAD、PUT、DELETE、TRACE、OPTIONS
(4) Access resources : The server obtains the resource requested in the request message web The server , That is, it's stored web Resource server , Responsible for providing static resources requested by the other party to the requester , Or resources generated after dynamic operation
(5) Build response message : once Web The server identifies resources in addition to resources , To perform the actions described in the request method , And return the response message . The response message contains the response status code 、 Response head , If the response body is generated , It also includes the response body
1) Response subject : If the transaction produces a response body , Put the content in the response message and send it back . The response message usually includes : Describes the response body MIME Type of Content-Type The first one 、 Describes the length of the response body Content-Length、 The main content of the actual message
2)URL Redirect :web The response of the service build is not a resource requested by the client , It's another access path to the resource
3)MIME type : Web The server is responsible for determining the response subject MIME type . There are many ways to configure the server MIME Type and resource management
(6) Send response message :Web When the server sends data through the connection, it also faces the same problems as receiving data . The server may have many connections to various clients , Some are idle , Some are sending data to the server , Some are sending back response data to clients . The server records the status of the connection , Special attention should also be paid to the handling of persistent connections . For non persistent connections , The server should send the whole message after , Close the connection at this end of yourself . For persistent connections , The connection may remain open , under these circumstances , The server should calculate correctly Content-Length The first one , Otherwise, the client will not know when the response ends
(7) Log : Last , When the transaction ends ,Web The server will add an entry to the log file , To describe the executed transaction
HTTP The status code is used to represent the web server HTTP Responding to the state of 3 Digit code .
common HTTP Status code :
200 ( success ) The server has successfully processed the request . Usually , This means that the server provides the requested web page .
301 ( A permanent move ) The requested page has been permanently moved to a new location . The server returned this response ( Yes GET or HEAD Response to the request ) when , The requester is automatically moved to a new location .
302 ( Temporary movement ) The server is currently responding to requests from pages in different locations , But the requester should continue to use the original location for future requests .
400 ( Wrong request ) The server does not understand the syntax of the request .
403 ( prohibit ) Server rejects request .
404 ( Not found ) The server could not find the requested page .
500 ( Server internal error ) Server encountered an error , Unable to complete request .
502 ( Bad Gateway ) Server as gateway or proxy , Invalid response received from upstream server .
503 ( Service not available ) The server is currently unavailable ( Maintenance due to overload or shutdown ). Usually , It's just a temporary situation .
504 ( gateway timeout ) Server as gateway or proxy , But the request was not received from the upstream server in time .
4、 The rendering principle of browser :
(1) structure DOM
(2) structure CSSOM Trees
(3) Build the render tree
(4) synthesis 、 draw
Browser workflow :
(1) The browser first uses HTTP Agreement or HTTPS agreement , Request a page from the server
(2) Come back with the request HTML The code is parsed , To build a DOM Trees
(3) Calculation DOM On the tree CSS attribute
(4) according to CSS Attribute to render elements one by one , Get the bitmap in memory
(5) An optional step is to synthesize the bitmap , This will greatly increase the speed of subsequent painting
(6) After synthesis , Then draw it on the interface .
The responsibility of the browser process : Mainly responsible for user interaction 、 Sub process management and file storage
Responsibilities of network process : Provide network download function for rendering process and browser process
Responsibility of rendering process : Download from the Internet HTML、JavaScript、CSS、 Pictures and other resources are parsed into pages that can be displayed and interacted
边栏推荐
- Market status and development prospect forecast of global heat curing adhesive industry in 2022
- Market status and development prospect prediction of the global autonomous hybrid underwater glider industry in 2022
- LVS load balancing cluster of efficient multi-purpose cluster (NAT mode)
- The programmer went to bed at 12 o'clock in the middle of the night, and the leader angrily scolded: go to bed so early, you are very good at keeping fit
- MC Layer Target
- Shuttle + Alluxio 加速内存Shuffle起飞
- First + only! Alibaba cloud's real-time computing version of Flink passed the stability test of big data products of the Institute of ICT
- 逆袭大学生的职业规划
- AWS VPC
- Market status and development prospect prediction of global neutral silicone sealant industry in 2022
猜你喜欢

Preparation for school and professional cognition

Handling record of electric skateboard detained by traffic police

FISCO bcos zero knowledge proof Fiat Shamir instance source code

Auman Galaxy new year of the tiger appreciation meeting was held in Beijing - won the double certification of "intelligent safety" and "efficient performance" of China Automotive Research Institute

First + only! Alibaba cloud's real-time computing version of Flink passed the stability test of big data products of the Institute of ICT

Leetcode simple question: check whether two string arrays are equal

Prepare for 2022 and welcome the "golden three silver four". The "summary of Android intermediate and advanced interview questions in 2022" is fresh, so that your big factory interview can go smoothly

逆袭大学生的职业规划

Triangular rasterization

Analysis of proxy usage of ES6 new feature
随机推荐
Introduction to JVM principle
Network security textual research recommendation
JDBC database operation
JS multidimensional array to one-dimensional array
普通本科大学生活避坑指南
Shell script Basics - basic grammar knowledge
Integration of Android high-frequency interview questions (including reference answers)
Market status and development prospect prediction of global SoC Test Platform Industry in 2022
Auman Galaxy new year of the tiger appreciation meeting was held in Beijing - won the double certification of "intelligent safety" and "efficient performance" of China Automotive Research Institute
Leetcode simple question: check whether two string arrays are equal
Thesis reading_ Chinese medical model_ eHealth
文献阅读_基于多模态数据语义融合的旅游在线评论有用性识别研究(中文文献)
Leetcode simple question: check whether the string is an array prefix
After reviewing MySQL for a month, I was stunned when the interviewer of Alibaba asked me
带有注意力RPN和多关系检测器的小样本目标检测网络(提供源码和数据及下载)...
[set theory] binary relationship (special relationship type | empty relationship | identity relationship | global relationship | divisive relationship | size relationship)
2022 registration examination for safety production management personnel of hazardous chemical production units and examination skills for safety production management personnel of hazardous chemical
论文阅读_ICD编码_MSMN
Games101 Lesson 9 shading 3 Notes
【工具跑SQL盲注】