This may be a very simple thing. I have never learned it before, so now I can remember it when I saw it and decided to help.
Redirect redirection: After page a is processed, the server sends the response to the client, and then sends the request to page B from the client.
Forward forwarding: only redirection from page a to page B is performed on the server.
The difference is that the client requests page B.
The redirection request is sent twice. If there are many users, the user's 2nd requests will be placed at the end of the Request queue, and the user may wait for a long time. the transfer will not cause such problems.
So do we all use transfer? In other words, under what circumstances should I use forwarding and under what circumstances should I use redirection?
- Transfers are generally restricted to the same application.ProgramTo jump to an external website, you must use redirection.
- During the transfer process, the target page can use the request of the previous page, that is, the requests of the two pages, and the requests are merged, therefore, multiple actions can interact with each other (action is an action of the Controller in Zend ). we recommend that you use redirection if it is just a simple page Jump or you do not want to confuse page requests.
For the time being, there is only so much.