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..
AJAXJScriptHTML

Avatar of undefined
Last Comment
Gurvinder Pal Singh

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
sscotti

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
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/
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck