方法三: 用随机数, 随机数也是避免缓存的一种很不错的方法!
URL 参数后加上 "?ran=" + Math.random(); // 当然这里参数 ran 可以任意取了
方法四: 用随机时间, 和随机数一样.
在 URL 参数后加上 "?timestamp=" + new Date().getTime();
用 php 后端清理
在服务端加 header("Cache-Control: no-cache, must-revalidate")
方法五:
window.location.replace("webForm1.aspx");
参数就是你要覆盖的页面, replace 的原理就是用当前页面替换掉 replace 参数指定的页面.
a.html
以下是引用片段:
- a
- language="javascript">
- function jump(){
- window.location.replace("b.html");
- }
- href="javascript:jump()" rel="external nofollow" rel="external nofollow">b
b.html
以下是引用片段:
- b
- language="javascript">
- function jump(){
- window.location.replace("a.html");
- }
- href="javascript:jump()" rel="external nofollow" rel="external nofollow">a
来源: http://www.bubuko.com/infodetail-2753228.html