Home > php教程 > php手册 > PHP设置客户端不缓存

PHP设置客户端不缓存

WBOY
Release: 2016-06-06 20:07:32
Original
1245 people have browsed it

PHP设置客户端不缓存: //设置此页面的过期时间(用格林威治时间表示),只要是已经过去的日期即可。 header(Expires: Mon, 26 Jul 1970 05:00:00 GMT); //设置此页面的最后更新日期(用格林威治时间表示)为当天,可以强制浏览器获取最新资料 header(Last-Modifi

PHP设置客户端不缓存:

<code class="language-text">//设置此页面的过期时间(用格林威治时间表示),只要是已经过去的日期即可。    
header("Expires: Mon, 26 Jul 1970 05:00:00 GMT");      
 //设置此页面的最后更新日期(用格林威治时间表示)为当天,可以强制浏览器获取最新资料     
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");      
 //告诉客户端浏览器不使用缓存,HTTP 1.1 协议     
header("Cache-Control: no-cache, must-revalidate");         
//告诉客户端浏览器不使用缓存,兼容HTTP 1.0 协议     
header("Pragma: no-cache");
</code>
Copy after login

原文:Lee's 程序人生

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template