Interview series chain gun (xiv): HTTP status code of the navigation logic 302

  1. 302 HTTP status code of the navigation logic
    302 status code indicates redirect the browser to get the status code returned from the server that will automatically jump to a new URL address, the address may be obtained (from a user of the Location response header to see the effect that he typed in the address a moment into another address B.

  2. 302 and 301 and use the difference between the scene
    301 is a permanent redirect, and 302 temporary redirection. 301 suitable for permanent redirect; 302 suitable for temporary jump.

    • Defined 301: 301 Moved Permanently requested resource has been permanently moved to a new location, and any future references to this resource should be used in response to one of several present URI returned. If possible, have a link editing capabilities of the client request should automatically be modified to address feedback from the server back address. Unless otherwise specified, otherwise the response is cacheable.
    • Defined 302: 302 Found requested resource is now the temporary response to a request from a different URI. Because of this redirection is temporary after, the client should continue to be sent to the address of the original request. When only is specified in the Cache-Control or Expires in this response it is cacheable.
  3. The difference between the server and the client jump jump

    • Server-side jump refers to the address bar contents remain unchanged (the client browser's address bar does not show the target URL address), after the client request arrives, the server could not find a response to the current resource, other resources within a server request Jump. So the client does not know whether or not to jump, belong to the first request.
    • The client is the address of the jump bar content changes, then the client sends a request to the server according to the response of the URL server again, so is the two requests. Client requests arrive on the server, the server returns a "link to access other" response.

Reference (excerpt of the text portion of the original author belongs Rights):

https://www.cnblogs.com/wanglei957/p/11114912.html https://www.cnblogs.com/ryelqy/p/10104131.html

Guess you like

Origin www.cnblogs.com/xiaoyangjia/p/11635965.html