PHP header (' cache-control:***,***,*** ')

Source: Internet
Author: User

The Web cache is controlled by the Cache-control in the HTTP message header, and the common values are private, No-cache, Max-age, Must-revalidate, and so on.

Browser access is divided into the following types of methods:

1, open a new window

In this case, the private,no-cache,must-revalidate will re-access the server

Max-age will not be re-accessed within the set time. If max-age=5, the server will not be accessed within 5 seconds

2. Enter the address in the address bar

In this case, Private,must-revalidate will revisit the server the first time

Max-age will not be re-accessed within the set time. If max-age=5, the server will not be accessed within 5 seconds

No-cache re-accessing the server

3, when you refresh the page

Will re-access the server

4, press backspace back key when

Private,must-revalidate,max-age does not access the server

No-cache re-accessing the server

The following code:

<?php

Header (' cache-control:private,must_revalidate ');

?>

can control caching

This article from "Chensir" blog, declined reprint!

PHP header (' cache-control:***,***,*** ')

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.