oboe Posted July 13, 2011 Share Posted July 13, 2011 Hi All, I'm working on a travel site that sends requests to the DB for available accommodations, at times there can potentially be hundreds of results. I'm planning on implementing filtering on the results page similar to that of expedia/travelocity with price range sliders, checkboxes for amenities etc. What I can't work out is how the big guys (travelocity/expedia/hotels.com) manage to filter the results almost instantly when the initial DB search takes 10+ seconds. I guess the results are cached somewhere either in the session or maybe locally, does anyone have any ideas how this works? Run a search on http://www.travelocity.com/ then play with the filters on the left and you will see what I mean. Pretty cool! Any suggestions appreciated! Link to comment https://forums.phpfreaks.com/topic/241856-large-mysql-calls-ajax-caching-of-results/ Share on other sites More sharing options...
xyph Posted July 13, 2011 Share Posted July 13, 2011 Could easily be cached server-side (sessions) or locally in a JavaScript array/object. With sessions you could use a token for that specific search and pass it along in the request string on all pages relating to that search. You could then store the results from the query in $_SESSION['tokenID'][0...x] Then, rather than re-polling the database, you could create a set of functions that polls the array instead. Link to comment https://forums.phpfreaks.com/topic/241856-large-mysql-calls-ajax-caching-of-results/#findComment-1242056 Share on other sites More sharing options...
oboe Posted July 13, 2011 Author Share Posted July 13, 2011 Thanks for the reply, xyph, confirmed what I was thinking! Cheers. Link to comment https://forums.phpfreaks.com/topic/241856-large-mysql-calls-ajax-caching-of-results/#findComment-1242341 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.