Link to home
Create AccountLog in
Avatar of brad0525
brad0525

asked on

disable caching while using ajax script

I am running an ajax script that calls a php script that runs a query and returns the values to a specific div.

The problem I am running into is that when I refresh the page the webpage wants to use the cashe because it will load faster, I want it to run the ajax script so it will run the query and show me the updated information...

I guess I need to disable to cashe...Thats what I am not sure how to do..
ASKER CERTIFIED SOLUTION
Avatar of sscotti
sscotti
Flag of United States of America image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of Gurvinder Pal Singh
make a new url everytime
var myTime = myDate.getTime();
var url=’http://localhost/call_to_ajax.php?rand=’+myTime;
http.open(‘GET’, url);

this will make sure that request goes to server every time
check this also
http://hungred.com/how-to/tutorial-stop-caching-jquery-javascript/
http://starcoder.wordpress.com/2006/12/05/deep-tech-fusion/