XpertWorlock Posted January 4, 2009 Share Posted January 4, 2009 This is just an example, a list that when you click a "Name" it retrieves server information "Age, Location, etc." If a PHP file makes the SQL request, does the page make a SQL request everytime a new name is clicked, or is the page cached? or can it be cached? I'm not asking for code or any help, I'd just like to get a better understanding on how AJAX works. Quote Link to comment Share on other sites More sharing options...
xtopolis Posted January 4, 2009 Share Posted January 4, 2009 It's possible for the page to be cached, based on your server settings, or the browser settings. Ajax makes a new HTTP request each time. It's just the same as if you were loading the page itself, only it does it in the background without you seeing it. What you could do is build a javascript array based on the names unique ID and have the page check to see if the extra data exists in javascript already (been clicked once) before asking the page to do an sql query. (Then take the query and store the info in the javascript so that it is now cached.) You can also use sessions to store that data. Quote Link to comment 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.