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");