In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article introduces the knowledge of "what happens after the browser enters baidu.com press enter". In the actual case operation, many people will encounter such a dilemma. Next, let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
Do you really understand what URL is?
We often use browsers to surf the Internet, and when we want to query certain websites, we will enter a string in the address bar of the browser, which is what we often call "URL". In fact, we are talking about this "URL", which means that the full name of URL,URL is Uniform Resource Location, which is called "unified resource location".
For example, if we want to access Google, we should enter it in the browser's address bar:
Http://www.google.com .
At this time, we can see two more important parts of the URL, one is the protocol, and the other is the resource name, which is separated by ": /". The http on the left is the protocol, and the www.google.com on the right is the resource name.
The protocol we use here is HTTP protocol, its full name is Hypertext transfer Protocol, there are many request protocols on the network, for example, other protocols we are familiar with are ftp protocol, https protocol and so on.
Why use the agreement?
Because there are no rules and no square, when we transmit data, we need to get the corresponding resources through the corresponding rules. For example, if you are at home and suddenly hungry and want to order takeout, then you need to find what you want to eat, and then pay for it. The merchant will cook it for you, and the takeout brother will send it to you with a smile. If you do not follow this rule, you will not pay, can you eat it? Will the takeout boy give it to you with a smile? Unless he's handsome.
So the HTTP protocol we use here can provide us with hypertext documents.
Resource name
The resource name is a complete address, and its format depends entirely on the protocol, but in most protocols, the resource name includes:
1.Host Name: the host name, that is, the name of the server, is usually the domain name, that is, the ip address of the server corresponding to the domain name. For example, www.google.com in http://www.google.com is the host name.
2.FileName: file name, that is, we want to access the file somewhere on the server, and the path name of this file is FileName. For example, if we want to access the photos under the teacher's directory on a server, then we can access it like this:
Http://www.a.com/teacher/ photos .jpg
The teacher/ photo here. JPG is FileName.
3.Port Number: Port number. This is the port for connection. We do not need to enter a port for access by default, because 80 is the default connection port. Generally, there are 0-65535 ports on a server. Which port it opens for you to access, you can only access it through the port it gives you. For example, if you are going to open a room and find that there are 65536 rooms in the hotel, then the customer service staff tells you that the 8000 room is available. Then after you pay, take your room card and play in room 8000. You won't go to 65536 rooms to play all over again.
This port is usually followed by a colon at the end and the port number on the colon. For example: http://www.google.com:80
4.Parameters: request parameters. We can use the parameters to access specific resources. Generally, add the acquaintance value of key-value to the address we visit. For example, if we want to visit the website, we can visit the first to tenth photos of Potomo's knot under the teacher directory of this website like this:
Http://www.a.com/teacher/pic/boduoyejieyi?start=1&end=10
All right, let's talk about what happened after you typed baidu.com in the browser.
You enter baidu.com in the address bar of Chrome
2.Chrome uses DNS to find the IP address corresponding to the domain name baidu.com:
The lookup process for DNS is as follows:
The Chrome browser will first find whether there is a cached DNS record. If the required record is not found in the browser cache, it will make a system call to get the cached record of the system.
If there is no record, the request will continue to the router, which has its own DNS cache.
If there is no record, it will go to ISP's DNS cache to view the record.
If there is no record, the DNS server of ISP will start a recursive search from the root server domain name server and get the IP address.
3. The browser sends a HTTP request to the baidu server
After obtaining the ip address of baidu, you can send a HTTP request to the baidu server. When we send a GET request through the URL address, a header message will be sent to the baidu server:
Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8Accept-Encoding:gzip, deflate, brAccept-Language:zh-CN,zh;q=0.8Cache-Control:no-cacheConnection:keep-aliveCookie:PSTM=1506157985; BIDUPSID=DA662DF344C147D17FB4828CCD795292;... Host:www.baidu.comPragma:no-cacheUpgrade-Insecure-Requests:1User-Agent:Mozilla/5.0 (Windows NT 6.1; Win64 X64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36
If you often write anti-climbing words, you should know them.
User-Agent is to provide the baidu server with browser type, operating system version, browsing plug-in, browser language and other information.
Accept tells the server what the type we need to receive looks like.
Connection:keep-alive is for later requests not to close the TCP connection.
Cookie is stored as text and is sent to the server every time it is requested. It can store the user's status, user name and other information.
4.baidu server 301 redirect response
Because we just typed baidu.com instead of www.baidu.com in the Chrome browser, the baidu server will permanently redirect our request response to www.baidu.com.
5.Chrome browser requests a redirected address
At this point, the Chrome browser knows that www.baidu.com is the address that baidu wants to access, so the Chrome browser will send another request to the baidu server.
The 6.baidu server processes requests
The baidu server receives the request at this time, it will check the parameters and cookie information of the request, and then perform some operations, such as storing the data, getting the data that needs to be requested from the database, and so on.
The 7.baidu server returned a HTML response
When the baidu server has processed the data, it will return the data to the browser, and a Response Headers will be sent to the browser:
Bdpagetype:1Bdqid:0xddf2be49000b5995Bduserid:0Cache-Control:privateConnection:Keep-AliveContent-Encoding:gzipContent-Type:text/html; charset=utf-8Cxy_all:baidu+09720a4fa84e5493ae7506a57de6bc05Date:Sat, 14 Oct 2017 09:39:32 GMTExpires:Sat, 14 Oct 2017 09:39:32 GMTServer:BWS/1.1Set-Cookie:BDSVRTM=49; path=/Set-Cookie:BD_HOME=0; path=/Set-Cookie:H_PS_PSSID=1440_13551_21103_24658; path=/ Domain=.baidu.comStrict-Transport-Security:max-age=172800Transfer-Encoding:chunkedVary:Accept-EncodingX-Powered-By:HPHPX-Ua-Compatible:IE=Edge,chrome=1
Response Headers explains whether to cache this page, how to interpret response information, cookie settings, privacy information, etc.
Among them
Content-Encoding:gzip tells the browser that the entire response body is compressed using the gzip algorithm.
Content-Type:text/html; charset=utf-8 tells the browser to render the response in the form of HTML, and the character set is utf-8.
8.Chrome browser displays baidu page
At this time, the Chrome browser gets the response content and begins to display the HTML page of baidu. When displaying, the browser finds that it needs to obtain other tag content, such as images, css style sheets and JavaScript files, then the browser will continue to send requests for these contents to the baidu server. These static files baidu will cache it and distribute it using the content delivery Network (CDN). So these static files are backed up in many CDN data centers, so browsers can get them quickly.
In order to make a complete display of the page bar:
This is the end of what happens after the browser has typed baidu.com and pressed enter. Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.