$.ajax({
url:"${ctx}/mdmdecodeapplyservice/mdmDecodeApplyService/applyDecode",
type:"post",
data:jsonData,
dataType:'json',
headers:{'Content-Type': 'application/json'},//设置请求头
success:function(data){
},
error:function(e){
console.log('ajax请求异常,异常信息如下:', e);
}
});
后来在网上找到了很多AJAX GET请求会被缓存解决方法总结一下
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();