1、在服务端加 header("Cache-Control: no-cache, must-revalidate");

2、在ajax发送请求前加上 anyAjaxObj.setRequestHeader("If-Modified-Since","0");

3、在ajax发送请求前加上 anyAjaxObj.setRequestHeader("Cache-Control","no-cache");

4、在 Ajax 的 URL 参数后加上 "?fresh=" + Math.random(); //当然这里参数 fresh 可以任意取了

5、第五种方法和第四种类似,在 URL 参数后加上 "?timestamp=" + new Date().getTime();

6、用POST替代GET:不推荐

相关文章:

  • 2021-09-27
  • 2022-02-07
  • 2021-09-09
  • 2021-07-27
猜你喜欢
  • 2022-12-23
  • 2021-06-07
  • 2022-12-23
  • 2022-02-03
  • 2021-07-24
  • 2022-02-14
  • 2021-12-23
相关资源
相似解决方案