Ajax IE 缓存 问题。。

1.客户端通过添加随机字符串解决

var url = BaseURL + "&timeStamp=" + new Date().getTime();
var url = BaseURL + "&r=" + Math.random();

2.服务端通过NoCacheFilter解决

  response.setHeader("Pragma","No-cache");
  response.setHeader("Cache-Control","no-cache");
  response.setDateHeader("Expires", 0);

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.