Front end interview HTTP Fundamental properties
1 HTTP agent
Between browser and server , There are many computers and other devices that forward HTTP news . In short , The middle part of them is agent ！
The role of agency
- cache （ It can be public or private , Like the browser's cache ）
- Filter （ Like anti-virus scanning , Parental control ...）
- Load balancing （ Let multiple servers serve different requests ）
- authentication （ Right management of different resources ）
- logging （ Allow historical information to be stored ）
HTTP Fundamental properties
HTTP It's simple.
HTTP It's extensible
HTTP Is a stateless 、 There is conversation
HTTP It's stateless ： In the same connection , There is no relationship between two successful requests .
This brings up a problem , There is no way for users to interact continuously in the same website , For example, in an e-commerce website ,
The user adds a product to the shopping cart , Switch to a page and add the product again , There is no correlation between the two requests to add the product ,
The browser doesn't know which products the user finally chose . While using HTTP The head extension of ,HTTP Cookies And then we can solve this problem .
hold Cookies Add to the head , Create a session so that each request can share the same context information , Reach the same state .
HTTP And connections 【 I don't understand now anyway ！】