码迷,mamicode.com
首页 > Web开发 > 详细

PHP___过期header expires

时间:2016-03-27 17:59:57      阅读:123      评论:0      收藏:0      [点我收藏+]

标签:

代理,浏览器缓存文档直到过期,缓存文档的重载不会联系服务器,尝试获取过期文档会联系服务器

设置文档的过期时间

header("Expires:Sun,27 Mar 2016 16:38:00 GMT");//GMT 格林尼治标准时间

x小时后过期

$now=time();

$then=gmstrftime("%a,%d %b %Y %H:%M:%S GMT",$now+60*60*3);//3小时后过期

header("Expires:{$then}");

永远不过期

$now=time();

$then=gmstrftime("%a,%d %b %Y %H:%M:%S GMT",$now+365*86440);

header("Expires:{$then}");

 

PHP___过期header expires

标签:

原文地址:http://www.cnblogs.com/HackHer/p/5326082.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!