1.在Asp页面首部<head>加入
Réponse.Buffer = True
Réponse.ExpiresAbsolute = Maintenant() - 1
Réponse.Expire = 0
Response.CacheControl = "pas de cache"
Response.AddHeader "Pragma", "Pas de cache"
2.在HtML代码中加入
<TÊTE>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
<META HTTP-EQUIV="Expire" CONTENT="0">
</HEAD>
3.
Href="****.asp?random()"
存是与参数相关的,如果
参数不同就不会使用缓存,而会重新生成页面,每次都传一个随机的参数就可以避免使用缓存。 Laréponse
à asp&asp.net
4 est la réponse à jsp.
.setHeader("Cache-Control","no-cache"); // HTTP 1.1
réponse.setHeader("Pragma","no-cache"); // HTTP 1.0
réponse.setDateHeader ("Expire", 0);
//
empêche la miseen
cache
sur le serveur
proxy
// HTTP 1.1
réponse.setHeader("Pragma","no-cache"); // HTTP 1.0
réponse.setDateHeader ("Expire", 0); //empêche la mise en cache sur le serveur proxy
%>
</head>
5。window.location.replace("WebForm1.aspx");
参数就是你要覆盖的页面,remplace的原理就是用当前页面替换掉replace参数指定的页面。
这样可以防止用户点击back键。使用的是javascript脚本,举例如下:
a.html
<html>
<tête>
<titre>un</titre>
<langage de script="javascript">
fonction saut(){
window.location.replace("b.html");
}
</script>
</tête>
<corps>
<a href="javascript:jump()">b</a>
</corps>
</html>
b.html
<html>
<tête>
<titre>b</titre>
<langage de script="javascript">
fonction saut(){
window.location.replace("a.html");
}
</script>
</tête>
<corps>
<a href="javascript:jump()">a</a>
</corps>
</html>
Cache 4 pour les fichiers Internet temporaires当前页面文件,并没有清空cache,也就是说Temporaire Internet Files来看看哦。
http://blog.csdn.net/yudinosaur/archive/2006 /12/27/1464421.aspx