我的站点脚本上的标题包括以下内容:
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
这些行在任何输出/空白之前被调用。
这是我的实时标题查看器中显示的内容:
POST /includes/whosonline.php HTTP/1.1
Host: mysite.org
User-Agent: Linux/Firefox 11
Accept: text/javascript, text/html, application/xml, text/xml, */*
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: keep-alive
X-Requested-With: XMLHttpRequest
X-Prototype-Version: 1.6.0.2
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Referer: https://mysite.org?id=123
Content-Length: 0
Cookie: [cookie stuff removed]
Pragma: no-cache
Cache-Control: no-cache
请注意,脚本的标头指定浏览器不缓存页面。到期日期早于当前日期。
为什么这不起作用?