Welcome Guest, Not a member yet? Register   Sign In
Clear Cache When made an Ajax Request?

Hi to All,
I Created one page with two tabs loading the data through ajax only, first tab contains form with some input fields, when i update the form through ajax it is updating in the database. When i click the second tab and again come back to first tab it is showing old data only but not showing new data. So the problem is that it showing the data from cache... how to clear the cache memory? When made an Ajax Request...

Anyone, Can Help me ...

Add a timestamp to your Ajax Request, so it won't cache the response.

Thanks nOxie.
But i am using jquery with ajax in CodeIgniter and having controllers and models, So how can we add timestamp to the url.

This is i am using for ajax request.

type: "POST",
url: site_url+'/sample_c/showForm/',
dataType: "html",
success: function(msg){
error: function(){
$.fn.colorbox({width:"76%", transition:"fade", title:"User Information", html:"Sorry! Browser failed to send your request. Please try again!!"});

var timestamp = Number(new Date()); // current time as number

  url: site_url+'/sample_c/showForm/'+timestamp,

Theme © iAndrew 2016 - Forum software by © MyBB