title: Can you clear jquery ajax cache?
body: <p>I am wondering if it is possible to clear the cache from a particular AJAX method.</p>
  
  <p>Say I have this:</p>
  
  <pre><code>$.ajax({
    url: "test.html",
    cache: true,
    success: function(html){
      $("#results").append(html);
    }
  });
  </code></pre>
  
  <p>Now 99% of the time, a cached result can be used since it should always have the same content. However, if a user updates this content, it (of course) changes. If it is cached, it would still show the old content.</p>
  
  <p>So, it would be cool if I could pick out this cache for this method and clear it and all the other cached stuff would stay.</p>
  
  <p>Can this be done?</p>
  
  <p><strong>Edit</strong></p>
  
  <p>I do not follow. I see that if you set <code>cache</code> to false, it makes a unique URL to prevent the browser from caching it. </p>
  
  <p>My problem is that I want it to be cached until someone does an update to it. Then it shouldn't be cached until they click on it again. Then it should be cached again.</p>
  
  <p>Basically, I have an update model dialog(jquery UI) that brings up an update form so that users can update a table row. When they click "Update," it updates that table row. Now one column can have, like, a couple of paragraphs worth of data and it makes the table look bad. </p>
  
  <p>So to preserve the table, I have in it's place a link called "Show Data". Now, when this is clicked, a dialog model box shows up and the data is pulled from the server.</p>
  
  <p>If they click on it 5 times it gets reloaded 5 times. That's why I want to cache it. However, if they click on it and it gets cached then for whatever reason they go and update that row and click on "Show Data," they will get the cached version, not the updated version.</p>
  
  <p>I could probably hide all the paragraphs and show them on will using jquery but I'd rather have it on demand. Otherwise there will be so much crap hidden and it will slow down the page (imagine if some guy has 50 rows and each one of those columns has like 1000 characters).</p>