WCF & AJAX: My submitted changes does not update in IE but on other browsers

Scenario:
My view doesn’t get updated when I submitted data through WCF service in IE with jQuery $.getJSON, $.ajax, etc…

But it works in chrome, Firefox, etc…

Why?

Because by default in IE, all the service request will get cached in the browser.

Solution:

We need to force the browser to not to do any caching on with ajax call in jQuery

  1. To do it globally, add the following line when document ready, $.ajaxSetup({ cache: false });
  2. To do it specifically within the method

$.ajax({
url: url,
type: “POST”,
cache: false,
contentType: “application/json; charset=utf-8”,
data: data,
dataType: “json”,
success: function (data) {

},
error: function (msg) {

}
});