session_cache_limiter() returns the name of the current cache limiter. If cache_limiter is specified, the name of the current cache limiter is changed to the new value. You may find that your pages aren't cached even if you don't output all of the headers above. There are a number of options that users may be able to set for their browser that change its default caching behavior. By sending the headers above, you should override any settings that may otherwise cause the output of your script to be cached. Additionally, session_cache_limiter() and the session.cache_limiter configuration setting can be used to automatically generate the correct caching-related headers when sessions are being used.
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");// 最后修改时间
header("Pragma: no-cache");//设置页面不使用缓存
其它的学习……
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); //设置页面失效期
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); //设置页面时间,当前时间肯定迟于Mon, 26 Jul 1997 05:00:00 GMT,所以页面进入后就已失效了。再入时浏览器会访问服务器
header("Pragma: no-cache"); //通知浏览器不使用缓存机制————使客户端总能得到最新的页面由于不同的浏览器对这些http协议支持程度不同,所以这几句通常一起出现
有什么区别?
You may find that your pages aren't cached even if you don't output all of the headers above. There are a number of options that users may be able to set for their browser that change its default caching behavior. By sending the headers above, you should override any settings that may otherwise cause the output of your script to be cached. Additionally, session_cache_limiter() and the session.cache_limiter configuration setting can be used to automatically generate the correct caching-related headers when sessions are being used.