Two ways to implement PHP page fallback

Source: Internet
Author: User
Have you ever been in a situation where the form went wrong and when you returned to the page, the information that was previously filled out was all gone. This article for you to introduce two kinds of support PHP page fallback method, for your reference.

Method 1, use the header method to set the message header Cache-control

Header (' Cache-control:private, Must-revalidate '); Support page Bounce

Method 2, using the Session_cache_limiter method

Must be written before the Session_Start method, otherwise error. Session_cache_limiter (' Private, must-revalidate ');

Attached, Cache-control message header field Description Cache-control Specifies the caching mechanism that requests and responses follow. Setting Cache-control in a request message or response message does not modify the caching process in another message processing process. The cache directives for the request include No-cache, No-store, Max-age, Max-stale, Min-fresh, only-if-cached, and the instructions in the response message include public, private, No-cache, No-store, No-transform, Must-revalidate, Proxy-revalidate, Max-age.

Message instruction Meaning: 1, public indicates that the response can be cached by any buffer. 2. Private indicates that the entire or partial response message for a single user cannot be shared with the cache. This allows the server to simply describe a partial response message for the user, and this response message is not valid for another user's request. 3. No-cache indicates that the request or response message cannot be cached 4, No-store is used to prevent important information from being inadvertently published. Sending in the request message will make the request and response messages do not use the cache. 5. Max-age indicates that the client can receive a response that is not longer than the specified time (in seconds). 6. Min-fresh indicates that the client can receive a response time that is less than the current time plus the specified time. 7. Max-stale indicates that the client can receive a response message that exceeds the timeout period. If you specify a value for the Max-stale message, the client can receive a response message that exceeds the specified value for the timeout period. For more detailed information about Cache-control, please refer to the header of the PHP file.

>>> you may be interested in the article: PHP page jump to a variety of methods summary page jump Code (PHP, ASP, JS Multi-version) PHP Header page jump notice php URL redirection (page jump) The Code PHP implementation page jump of a different way PHP implementation of several methods of page jump header jump and include include problem instance analysis

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.