做了一个项目,生成的静态页,用户在静态页(主页)上点击后跳转到购买页,购买成功后返回主页,此时主页上的购买数量应该增加了,可以必须要手动刷新一下才能看到变动,上网查了好多资料。说在head区加:
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache, must-revalidate">
<meta http-equiv="expires" content="Mon,1 Jan 2001 08:10:10 UTC"> 可是试过一点用没有,给URL后面加时间戳的做法不现实,因为我的跳转连接很多,这样就很难控制,已经为这个问题折磨一个通宵了,谁能帮忙解决下~!!谢谢
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache, must-revalidate">
<meta http-equiv="expires" content="Mon,1 Jan 2001 08:10:10 UTC"> 可是试过一点用没有,给URL后面加时间戳的做法不现实,因为我的跳转连接很多,这样就很难控制,已经为这个问题折磨一个通宵了,谁能帮忙解决下~!!谢谢
Response.Buffer = true;
Response.ExpiresAbsolute = System.DateTime.Now.AddMonths(-120);
Response.Expires = 0;
Response.CacheControl = "no-cache";
Response.AddHeader("pragma", "no=cache");
<meta http-equiv="Expires" content="0"/>
<meta http-equiv="Pragma" content="no-cache"/>
<meta http-equiv="imagetoolbar" content="no"/> 生成HTML静态页面的时候加上
在window.onload=function ()
{
更新购买数量显示
}
反正你的HTML都不读参数
2楼的方法应该没问题