私のサイトスクリプトのヘッダーには、次のものが含まれています。
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
スクリプトのヘッダーは、ブラウザがページをキャッシュしないことを指定していることに注意してください。有効期限は現在の日付より前です。
なぜこれが機能しないのですか?