Jquery – How to prevent a jQuery Ajax request from caching in Internet Explorer

internet explorerjquery

How do I prevent a jQuery Ajax request from caching in Internet Explorer?

Best Answer

You can disable caching globally using $.ajaxSetup(), for example:

$.ajaxSetup({ cache: false });

This appends a timestamp to the querystring when making the request. To turn cache off for a particular $.ajax() call, set cache: false on it locally, like this:

$.ajax({
  cache: false,
  //other options...
});