对于一个小型的Intranet网站,我有一个dynamic的(包括AJAX)页面被Firefoxcaching不正确。 有没有一种方法来禁用单页浏览器caching?
这是我使用的设置:
XAMPP下的Apache,运行在Windows服务器上
澄清
我主要关心的内容是页面文本和某些<select>的默认选项。 所以我不能随便在一些图片url的末尾添加随机数字。
更新:
我遵循了迄今为止得到的build议:
使用Grok for LogstashparsingApache2错误日志
tomcat通过进程idclosures(windows)
PHP名字空间不工作 – 怀疑是PHPconfiguration问题
HttpWebResponse不会扩展并发出站请求
我发送nocache标题(见下文)
如果页面在2秒后重新加载,我将包含一个时间戳URL参数并redirect到一个新的参数,如下所示:
$timestamp = $_GET['timestamp']; if ((time()-$timestamp) > 2) { header('Location:/intranet/admin/manage_skus.PHP?timestamp='.time()); }
现在Firebug显示标题没有指定caching,但问题依然存在。 以下是页面的响应标题:
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
Apache全球基本身份validation
.htaccess mod-rewrite apache混淆导致每天10k 404的结果
如何更改cPanel的默认端口?
如何重写URL而不刷新,如GitHub.com
Apache 2.4.3(带有XAMPP 1.8.1)不能从Windows 8启动
添加当前时间戳作为url的参数,例如
http://server.com/index.PHP?timestamp=125656789
我想这告诉你你想要什么:
http://www.thesitewizard.com/archive/PHPtutorial2.shtml
寻找“防止浏览器缓存”
header( "Expires: Mon,20 Dec 1998 01:00:00 GMT" ); header( "Last-Modified: " . gmdate("D,d MYH:i:s") . " GMT" ); header( "Cache-Control: no-cache,must-revalidate" ); header( "Pragma: no-cache" );
您应该发送以下标题:
Cache-control: no-cache
在HTTP响应中。
Cache-Control: no-cache
而且(为了向后兼容HTTP / 1.0客户端)
Pragma: no-cache
试试这个在你的<head> </head>部分:
<Meta http-equiv="cache-control" content="no-cache,no store"/> <Meta http-equiv="Expires" Content="Mon,25 May 2009 19:07:03 GMT">
http://forums.mozillazine.org/viewtopic.PHP?f=25&t=673135&start=75
使用header()函数。 你必须设置一些涵盖所有的浏览器; 见http://www.PHP.net/manual/en/function.header.PHP#75507
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。