During the development process, the information filled in when the page is returned due to a form error is often lost. to support page jump, you can use two methods. First, set the message Header Cache-controlheader ('cache-control: p
During the development process, the information filled in when the page is returned due to a form error is often lost. to support page jump, you can use two methods.
First, apply the Header method to set the message Header Cache-control
Header ('cache-control: private, must-revalidate'); // supports page bounce
Second, apply the session_cache_limiter method.
// Be sure to write it before the session_start method.
Session_cache_limiter ('private, must-revalidate ');
PS: clarified the Cache-Control Message header domain
Cache-Control specifies the Cache mechanism for requests and responses. Setting Cache-Control in a request message or response message does not correct the Cache processing process in another message processing process. Cache commands in the request include no-cache, no-store, max-age, max-stale, min-fresh, only-if-cached, the commands in the response message include public, private, no-cache, no-store, no-transform, must-revalidate, proxy-revalidate, and max-age. The instructions in each message are as follows:
The Public instigating response can be cached in any cache area.
Private: all or part of the response messages of a single user cannot be shared and cached for processing. This allows the server to only describe part of the user's response message, which is invalid for other users' requests.
No-cache: request or response messages cannot be cached
No-store is used to prevent the unintentional announcement of important information. Sending in a request message does not cache the request and response message.
Max-age allows the client to receive responses with a lifetime not greater than the specified time (in seconds.
The min-fresh command allows the client to receive a response whose response time is earlier than the current time plus the specified time.
Max-stale allows the client to receive response messages beyond the time limit. If the value of the max-stale message is specified, the client can receive response messages beyond the value specified in the hyper-era.