PHP back page expired or no problem/click to refresh

Source: Internet
Author: User

 

Recently, I used php as a project and used post to submit data. There are sessions in it for record. It is okay to run it, but there is a small problem, after the submission, the page will expire when you want to return to the previous page. You need to click Refresh to open the page. You can add a statement on the PHP page to solve this problem.

Header ("cache-control: Private ");

· PHP back-to-page expiration or no problems

Cache-control. common values include private, no-cache, Max-age, and must-revalidate. The default value is private. The function of browser review is divided into the following situations:
1> open a new window. If the cache-control value is private, no-cache, or must-revalidate, the server will be accessed again when the new window is opened. If the max-age value is specified, the server will not be accessed again during this period, for example: cache-control: max-age = 5 indicates that the server will not be accessed again within 5 seconds after the webpage is accessed

2> in the address bar, press Enter. If the value is private or must-revalidate (different from that on the Internet), the server will be accessed only when the first access is made and will not be accessed later. If the value is no-cache, it will be accessed every time. If the value is Max-age, the access will not be repeated before expiration.

3> press the back button. If the value is private, must-revalidate, or Max-age, no re-access will be performed. If the value is no-cache, the re-access will be performed each time.

4> press the refresh button to repeat all the values. When the specified cache-control value is "no-Cache", accessing this page will not leave a page backup in the temporary article folder on the Internet.

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.