HTTP Header header Set reverse proxy not cached

Source: Internet
Author: User

One: Concept description

Expries: Page cache expiration time, to the specified date page cache failure

Last-modified: Latest update time for Web pages

Cache-control Cache Control

No-cache: Do not cache Web pages

No-store: Do not cache Web pages, if any, delete them

Must-revalidate: Enable the server response to use cache lifetime before it takes effect

The post-cache:ie5.0 "lazy" update switch, set to 0, indicates a timely update.

The pre_cache:ie5.0 "lazy" update switch, set to 0, indicates a timely update.

Max-age: With expires, priority is higher than expires, will overwrite expires value.

Pragma

No-cache: Do not cache Web pages, in order to compatible browsers, some browsers set some instructions valid.

Note: All time settings are in GMT format, which is the HTTP time (http-date) format specified in the HTTP protocol

Second: PHP output control

A: output is not cached

Header ("Expires: A Time in the past");

Header ("Last-modified: Current Time");

Header ("cache-control:no-stroe,no-cache,must-revalidate,post-check=0,pre-check=0");

Header ("Pragma:no-cache"); Reverse proxy can not cache Web pages

Example:

Header ("Expires:mon, June June 1997 05:00:00 GMT");

July 26, 1997 cache expiration, because the time is already past, so cache failure.

Header ("last-modified:"). Gmdate ("D, D M Y h:i:s"). "GMT");

Cache Update Time

Header ("Cache-control:no-cache, Must-revalidate, No-store, No-cache, Must-revalidate, post-check=0, pre-check=0");

Do not cache Web pages

Header ("Pragma:no-cache");

Do not cache Web pages

B: Output Permanent cache

Header ("Expires: A Time in the future");

Header ("Last-modified: Current Time");

C: Expiration after part of output cache time

Header ("Expires: Time of Expiration");

Or: Header ("cache-control:max-age= seconds");

Header ("Last-modified: Current Time");

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.