scuff Posted March 7, 2009 Share Posted March 7, 2009 so I have this code that uses ajax to update every second and because internet caches I need to use urls with random queries on the end like this var randomnumber = Math.floor(Math.random()*1000001) var file = 'serverTime.php?dummy='+randomnumber; ajaxRequest.open("GET", file, true); ajaxRequest.send(null); but the problem is, is that it creates a lot of files in the temporary internet files folder, so if they are on the page for along time it makes a lot of files and takes up room on their hard drive. Is there any way to do this without creating thousands of temporary files? Quote Link to comment https://forums.phpfreaks.com/topic/148407-solved-ajax-problem/ Share on other sites More sharing options...
corbin Posted March 8, 2009 Share Posted March 8, 2009 You could send the correct headers in the PHP file to tell the client to not cache the content. (Google "PHP don't cache" and something should come up.) No guarantees that that will work 100% of the time with all browsers though. Quote Link to comment https://forums.phpfreaks.com/topic/148407-solved-ajax-problem/#findComment-779306 Share on other sites More sharing options...
scuff Posted March 8, 2009 Author Share Posted March 8, 2009 thanks a lot! it seems to be working in ie and i'll test in other browsers later Quote Link to comment https://forums.phpfreaks.com/topic/148407-solved-ajax-problem/#findComment-779735 Share on other sites More sharing options...
corbin Posted March 8, 2009 Share Posted March 8, 2009 I'm sure the other browsers will handle it correctly. IE was the one I was wondering about ;p. But still, safest to test it. Quote Link to comment https://forums.phpfreaks.com/topic/148407-solved-ajax-problem/#findComment-779737 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.