Contents of this page
1. What is a Web
2.HTTP Protocol Overview
Two types of 3.HTTP connections
4.HTTP Message Format
5.Cookie Technology
6.WEB Caching/Proxy service technology
1. What is a Web
The web is the World Wild web (WWW), invented by Tim Berners-lee.
The web is made up of web pages that enable Web pages to connect to each other .
A Web page (Web page) contains multiple objects (Objects), such as: HTML files, JPEG pictures, video files, dynamic scripts, and so on. Where the basic HTML file contains links to other object references .
The object's addressing (adressing) is done through the URL(Uniform resoure Locator) Uniform Resource Locator .
The format is: Scheme://host:port/path: Http://www.somecompany.com/somePic/pic.png (Http is protocol name, www.somecompany.com is hostname , Somepic/pic.png to pathname)
2.HTTP Protocol Overview
Http=hypertext Transfer protocol= Hypertext Transfer Protocol
It uses the C/s network architecture:
Customer--browser: request, receive, and display Web objects.
Server--web: Sends an object in response to a customer request.
It is using the TCP Transport service, which works as follows:
1. Server waiting for customer request on port 80
2. Browser initiates a TCP connection to the server
3. The server receives a TCP connection from the browser
4. The browser (HTTP client) exchanges HTTP messages with the Web server (HTTP server)
5. Close the TCP connection
HTTP provides a stateless (stateless) service in which the server does not maintain any information about the client's past requests .
Two types of 3.HTTP connections
HTTP connections have two types of non-persistent connections and persistent connections.
Each TCP connection in a non-persistent connection (nonpersistent HTTP) allows a maximum of one object to be transferred, which works as follows:
Each TCP connection in a persistent connection (persistent HTTP) allows multiple objects to be transferred, which works as follows:
After the response is sent, the server keeps the TCP connection open and subsequent HTTP messages can be sent over this connection.
4.HTTP Message Format
The HTTP protocol has two types of messages: a request message and a response message (response).
Let's take a look at the example of the request message first:
Not hard to see, request line contains a simple request to retrieve a resource identified in the URI, represented by a GET method.
Header lines contains the hostname (host), the browser information (user-agent), the state of the Long Connection (Connection), and the language (accpet-language) used.
Let's now introduce the upload input method for the request message.
Post method and URL method:
The Post method is to upload the client's input in the message body of the request message, such as a form that the page often needs to fill out.
The URL method uses the Get method to have the input information uploaded through the URL field of the request line.
Let's look at an example of the response message:
The status line contains the protocol name (http/1.1), the Status code (State code=200), and the status phrase (State Phrase=ok).
The header lines contains the status of the long Connection (connection=close), the date of the connection (date), the Server Software (server), the last Modified time (last-modified), and so on.
HTTP response Status Code:
5.Cookie Technology
Because the HTTP protocol is stateless, it is impossible to know the customer's information, making some applications difficult to implement, such as online shopping (you need to master the status of the client).
Cookie technology can be a good solution to this problem.
A cookie is a mechanism for storing data on a remote browser and tracking and identifying the user's identity. That is, a cookie is a small piece of data stored on the client, and the browser (that is, the client) interacts with the cookie via the HTTP protocol and server side.
Components of a cookie:
6.WEB Caching/Proxy service technology
In order to shorten the time of customer request to response , we have invented Web caching technology to achieve a wide range (Internet) effective content distribution.
It works as follows:
Application of computer network 16--web