World Wide Web WWW (World Wide Web) is not a particular computer network, but a large-scale, on-line information store.
The World Wide Web uses a linked approach to easily access another site from one site on the Internet, proactively acquiring rich information on demand. This type of access is called a " link ."
The World Wide Web works on a client server basis . The browser is the World Wide Web client on the user's computer. The computer on which the World Wide Web document resides is running a server program, so this computer is also known as the World Wide Web server .
The client program makes a request to the server program and the server program sends the client program back to the Web document that the customer wants.
Uniform Resource Locator URL
Uniform Resource Locator URL (Uniform Resource Locator) has a unique identifier for each document within the scope of the entire Internet.
Consists of two large parts separated by a colon, and characters in the URL are not required for uppercase or lowercase .
The general form of the URL is:
< protocol >://< host >:< port >/< path >
A protocol is a protocol that is used to obtain a World Wide Web document. Now the most commonly used protocol is HTTP, followed by FTP.
Hypertext Transfer Protocol HTTP
The HTTP protocol defines how a browser can request a Web document from a World Wide Web server and how the server transmits the document to the browser.
From a hierarchical point of view, HTTP is a transaction-oriented (transaction-oriented) Application layer protocol, which is an important basis for reliable exchange of files (including text, sound, images, etc.) on the World Wide Web.
The general work of the World Wide Web is as follows:
Each Web site has a server process that constantly listens on TCP port 80 to see if a browser is making a connection request to it. Once a request for a connection is heard and a TCP connection is established, the browser sends a request to the World Wide Web server for a page, and the server then returns the requested page as a response. Finally, the TCP connection is freed.
If we click on a hyperlink pointing to "Www.tsinghua.edu.cn/chn/yxsz/index.htm", the following events will occur under the http/1.0 standard:
(1) Browser analysis hyperlink to the URL of the page.
(2) The browser resolves the IP address of the www.tsinghua.edu.cn to the DNS request.
(3) Domain Name System DNS resolves the IP address of the Tsinghua University server.
(4) The browser establishes a TCP connection with the server
(5) The browser issues the command to take the file:
Get/chn/yxsz/index.htm.
(6) The server gives a response and sends the file index.htm to the browser.
(7) The TCP connection is released.
(8) The browser displays all the text in the "Tsinghua University Setup" file index.htm.
The HTTP 1.0 protocol is stateless (stateless). In other words, when the same customer accesses a page on the same server for the second time, the server responds the same as the first time it was accessed. The server does not remember the user who has visited, or how many times it has been visited.
The HTTP protocol itself is also non-connected , although it uses a connection-oriented TCP up-delivery service. Although HTTP uses a TCP connection, both sides of the communication do not need to establish an HTTP connection before exchanging HTTP messages.
Unlike http/1.0, http/1.1 uses a continuous connection . That is, the World Wide Web server still maintains this connection for a period of time after sending a response so that the same client (browser) and the server can continue to transmit subsequent HTTP request messages and response messages on this connection.
This is not limited to sending documents linked on the same page, but only if the documents are on the same server.
HTTP has two types of messages:
Request message --sends a request message from the customer to the server.
response Messages -from the server to the customer's answer.
The structure of the request message is as follows:
The message consists of three parts: the start line , the first row , and the entity body . In the request message, the start line is the request line.
The structure of the response message is as follows:
The start line of the response message is the status line . The status line consists of three items, the version of HTTP, the status code, and a simple phrase explaining the status code.
The status codes are three-digit numbers:
1XX represents a notification message, such as a request received or being processed.
2xx means success, as accepted or known.
3XX indicates redirection, indicating that further action must be taken to complete the request.
4XX represents a customer error, such as a bad syntax in the request or a failure to complete.
5XX indicates a server error, such as failure of the server to complete the request.
Proxy Server
Proxy Server (proxy server), also known as the World Wide Web cache (webcache), makes HTTP requests on behalf of the browser.
The World Wide Web cache temporarily holds some of the most recent requests and responses on the local disk. When a new request arrives with the same request as a temporary deposit, the World Wide Web cache sends a staged response without needing to go to the Internet to access the resource at the URL's address.
Using caching reduces the latency of access to the Internet server and does not use the cache as follows:
The following scenarios are used for caching:
(1) When a browser accesses the Internet server, it first establishes a TCP connection with the campus network's cache and sends an HTTP request message to the cache.
(2) If the cache has already stored the requested object, the object is placed in an HTTP response message and returned to the browser.
(3) Otherwise, the cache represents the user's browser that makes the request, establishes a TCP connection with the source-point server on the Internet, and sends an HTTP request message.
(4) The source point server places the requested object in the HTTP response message and returns it to the campus network cache.
(5) After the cache receives this object, it is copied in its local storage (for future use) and then placed in an HTTP response message, which is returned to the browser requesting the object through the established TCP connection.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.