Jump to content

Large MySql calls / AJAX / caching of results


oboe

Recommended Posts

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!

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.