Web项目缓存问题

常做WEB项目,缓存问题难免会遇到,能够找到合适的解决方案才是王道,下面是在下的几种尝试

1、在每一页的head中加入如下代码

1 <meta http-equiv="pragma" content="no-cache">
2 <meta http-equiv="cache-control" content="no-cache">
3 <meta http-equiv="expires" content="0">

此方法,我试过了,不灵

2、在每一个请求URL后,加入时间戳,例

window.location.href = contextPath + "/index.action"+"?timestamp="+new Date().getTime();

这个是很管用的,亲测,若有问题,请指正批评

原文地址:https://www.cnblogs.com/godboy1989/p/3836822.html