Nat*_*ong 5 php apache xampp caching
对于一个小型Intranet站点,我有一个动态(包括AJAX)页面被Firefox错误地缓存.有没有办法禁用单个页面的浏览器缓存?
这是我正在使用的设置:
我主要关注的内容是页面文本和某些<select>
s中的默认选项.因此,我不能仅在一些图像URL的末尾添加随机数.
我遵循了迄今为止的建议:
如果页面在2秒后重新加载,我将包含一个时间戳URL参数并重定向到一个新参数,如下所示:
$timestamp = $_GET['timestamp'];
if ((time()-$timestamp) > 2) {
header('Location:/intranet/admin/manage_skus.php?timestamp='.time());
}
Run Code Online (Sandbox Code Playgroud)现在,Firebug显示标头没有指定缓存,但问题仍然存在.以下是该页面的响应标头:
Date Fri, 25 Sep 2009 20:41:43 GMT
Server Apache/2.2.11 (Win32) DAV/2 mod_ssl/2.2.11 OpenSSL/0.9.8i mod_autoindex_color PHP/5.2.8
X-Powered-By PHP/5.2.8
Expires Mon, 20 Dec 1998 01:00:00 GMT
Last-Modified Fri, 25 Sep 2009 20:41:43 GMT
Cache-Control no-cache, must-revalidate
Pragma no-cache
Keep-Alive timeout=5, max=100
Connection Keep-Alive
Transfer-Encoding chunked
Content-Type text/html
Run Code Online (Sandbox Code Playgroud)
添加当前时间戳作为url的参数,例如
http://server.com/index.php?timestamp=125656789
Run Code Online (Sandbox Code Playgroud)