Hi
I am wondering is it possible to clear the cache from a particular ajax method?
Say if I have this
$.ajax({
url: "test.html",
cache: true,
success: function(html){
$("#results").append(html);
}
});
Now 99% of the time a cached result can be used since it should always be same content. However if a user updates this content it of course changes. If it is cached and it would still show the old content.
So it would be cool if I could pick out this cache for this method and clear it and all other cached stuff would stay.
Can this be done?
Edit
I am not following. I see if you set it to false it make a unique url to stop the browser from caching it.
My problem is I want it to be cached until someone does an update to it. Then it can't be cached. Until they click on again.Then it should be cached again.
Basically I have an update model dialog(jquery UI) that brings up a update form. So they can update that table row. When they click update it updates that table row. Now one column can have like a couple paragraphs worth of data and it makes the table look bad.
So to perverse the table I have in it's place a link called "Show Data". Now when this is clicked on a dialog model box shows up and the data is pulled from the server.
So if they click on it 5 times it gets reloaded 5 times. Thats 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 now the new version.
I probably could like hide all the paragraphs and show them on will using jquery but I 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).