We are using $.get()
in our codes to perform AJAX
calls. We have noticed that IE
actually caches our request and the DB hit doesn't happen until the browser cache is cleared.
To encounter this, we have used cache:false
in few of the $.get()
calls as given below:
$.get({url:'/Area/Controller/ActionMethod',cache:false, data:data})
.then(function (response) {
if (response != undefined) {
alert('Success');
}
})
.fail(function (xhr, statusText, error) {
console.log(xhr);
})
.always(function () {
});
But we have over 500 different $.get()
calls in our code base. How can we globally set cache
as false
for all the $.get()
calls.
I understand that if we were using $.ajax()
calls, we would have been able to set cache
as false
in $.ajaxSetup()
.
I searched for the above but couldn't find substantial results.
Please assist.
Thanks