What is the correct way to prevent caching on ajax calls?
<p>I have an AJAX-call, which returns values from a ever changing database, based on simple standard parameters, like month of year. In IE, this function returns cached data, which it never should. I've monitored the server side, and it isn't contacted by the client.</p>

<p>Now, my title question has been asked in different ways, many times here already. The top two solutions are:</p>

<ul>
<li>set <code>cache: false</code></li>
<li>Pass a random number/string/timestamp to make the call unique.</li>
</ul>

<p>The thing is though, that <code>cache: false</code> doesn't work, at least not in my application. On the other hand, passing a unique string to prevent caching, seems like a quick fix hack. I don't like it. So what is the correct way of preventing caching on ajax calls?</p>

<p>Ajax call that doesn't work in regards of preventing caching:</p>

<pre><code>$.getJSON("myURL", {
        json : jsonDataObject,
        cache: false
    }).success(function(data) {                 
        //do something with data
});  
</code></pre>

<p>I have also tried calling <code>$.ajaxSetup({ cache: false });</code> on it's own, before the calls happen, but to no effect...</p>