PHP back page expired or no problem/click Refresh

Source: Internet
Author: User

Recently used PHP to do projects with a post to submit data and there is a session to do the record, run up, but there is a small problem, is submitted after the previous page will be back when it would appear page expired, to click Refresh can open this page, You can add a single statement to the PHP page to resolve

Header ("Cache-control:private");

· PHP back page expired or no problem

Cache-control "to control, the common value has private, No-cache, Max-age, must-revalidate, etc., the default for private. Its role is divided into the following situations according to different ways of re browsing:
1> Open a new window if the specified Cache-control value is private, No-cache, Must-revalidate, the server will be accessed again when a new window is opened. If the Max-age value is specified, then the server is not returned in the time within this value, for example: cache-control:max-age=5 means that access to the Web page after 5 seconds will not go to the server


2> in Address bar carriage return if the value is private or must-revalidate (unlike what is said on the web), the server is accessed only on the first visit and is no longer accessible. If the value is No-cache, it is accessed every time. If the value is Max-age, the access is not repeated until it expires.


3> Press the Back button if the value is private, must-revalidate, Max-age, it will not be accessed, and if it is No-cache, repeat access each time

4> Press the Refresh button regardless of the value, it will be repeatedly accessed when the specified Cache-control value is "No-cache", accessing this page does not leave a page backup on the Internet temporary article folder.



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.