Why setting Cache-control does not work

Source: Internet
Author: User
I'm using the thinkphp framework I want to back up a page when you click the browser's Back button when the back page reloads instead of reading the cache I added the header ("Cache-control:no-cache") to the Controller method on this page. Must-revalidate "); But Cache_control doesn't work.

Reply content:

I'm using the thinkphp framework I want to back up a page when you click the browser's Back button when the back page reloads instead of reading the cache I added the header ("Cache-control:no-cache") to the Controller method on this page. Must-revalidate "); But Cache_control doesn't work.

I am using the thinkphp frame TP box Cache_control default is private so I set in the controller does not work I changed the configuration file on it.

header("Cache-Control: no-store, no-cache, must-revalidate");header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); //过去的时间

See Bird Brother This article: http://www.laruence.com/2010/03/05/1332.html, for the refresh, F5, backward is not the same, you really do use the cache, rather than re-download

  • 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.