HTTP connections long and short connection? The difference between forward and redirect? cookie and session?

Talk to you next long HTTP connections and short connections understanding?
Default short connection in HTTP / 1.0 in. In other words, the client and the server once for each HTTP operation, once the connection is established, the task will end disconnected. When an HTML Web page or other type of client browser to access the Web contains other resources (such as: JavaScript files, image files, CSS files, etc.), when confronted with such a Web resource, the browser will re establish an HTTP session.

From the HTTP / 1.1 cases, long default connection for holding the connection characteristics. A long connection using the HTTP protocol, which will be added in response to the first line of code:

Connection:keep-alive

In the case when TCP long connection, when a page is opened is completed, for the transmission of HTTP data between the client and the server connection is not closed, clients access the server again, we will continue to use a connection has been established .

Keep-Alive not permanently remain connected, it has a hold time, may be (eg: Apache) in different server software set this time. Achieve a long connection requires a client and server support long connection.

the difference between forward and redirect?
Forward and Redirect forwards the request on behalf of two ways: direct and indirect forwarding to forward.

Direct forwarding mode (Forward): The client browser and only make a single request, Servlet, HTML, JSP, or other resource information, the resource by the second information in response to the request, the request in the request object, for each information object stored resources are shared.
Indirect forwarding mode (Redirect): actually twice HTTP request, the server in response to the first request, let the browser again another URL request, so as to achieve the purpose of forwarding.
For popular example:

Forwarded directly equivalent: "A B looking to borrow money, say no B, C B go borrow, borrow to borrow will pass the message to A";
indirect forwarding is equivalent to: "A borrow money to find a B, B He said no, let go A C borrow. "

"Cookie and session have to understand it?"
HTTP protocol is a stateless protocol, we can use the session cookie and to maintain session state. The user initiates the request, the server after receiving the request processing can generate a sessionId, and will return sessionId into a cookie to the client, the session will be the content stored in the server. The next request, the client request with a cookie to the server, the server sessionId removed from the cookie, the user holding implement session state.

This has the drawback is that some things exist on the server, in a large number of users, the server capacity will be insufficient. In reality, often will require session state, for example, to log directly into the cookie state and returned to the client, the next request, the server directly extract information and parameter information in the cookie compare maintain HTTP session state .

Summary: session stored on the server. cookie stored in the client, and the cookie is limited in size.

After a basic understanding of the HTTP protocol, let us simply look at what is the SSL protocol it ~
SSL protocol:
HTTPS protocol added SSL (Secure Sockets Layer) protocol based on HTTP, SSL TLS protocol to evolve, but the industry's habit still call this SSL protocol.

SSL protocol to establish a secure connection based on the transmission control layer, as reliable a common security solution, used in conjunction with a variety of application layer protocols, the secure transmission of application data. SSL protocol is divided into recording agreement, handshake agreement, warning protocols and cryptographic protocol specification change:

发布了72 篇原创文章 · 获赞 2 · 访问量 1022

Guess you like

Origin blog.csdn.net/baidu_41592938/article/details/104469401