对于PHP产生的动态内容,只需要在内容输出之前输出强制缓存的header即可,比如下面的代码即要求浏览器缓存文件1个月: <?php header("Cache-Control: public"); header("Pragma: cache"); $offset = 30*60*60*24; // cache 1 month $ExpStr = "Expires: ".gmdate("D, d M Y H:i:s", time() + $offset)." GMT"; header($ExpStr); ?> 具体参考:http://www.cnblogs.com/phpxue...
对于PHP产生的动态内容,只需要在内容输出之前输出强制缓存的header即可,比如下面的代码即要求浏览器缓存文件1个月:
具体参考:http://www.cnblogs.com/phpxue...