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:不推荐
|
|
| | |