Ajax的IE缓存问题

Ajax的IE缓存问题,会造成用open时用get方法不能重复提交。解决的办法有以下几种:
1.客户端在url后添加随机数.
new Date().getTime()或者Math.Random()
或者送请求前加上
XMLHttpRequest.setRequestHeader("If-Modified-Since","0")
或者用post方法提交
2.服务器端禁用缓存.
response.setHeader("Pragma","No-cache");
response.setHeader("Cache-Control","no-cache");
response.setDateHeader("Expires", 0); 

Response.AddHeader("pragma", "no-cache");
Response.AddHeader("cache-control", "no-cache");
Response.AddHeader("expires", "0");

你可能感兴趣的:(c,Ajax,cache,IE,asp)