tags:

views:

83

answers:

4

Hello, I need a kayak.com like, functionality.

That is, the user enters a keyword and I will need to display results as the become available. The important thing is that data should be displayed AS it BECOMES available. Kind of progressive display? Don't know if this is right term.

Kayak.com displays or gives the impression that data is displayed as they become available after an asynchronous call.

Can anyone give directions on this topic? (php on the server side) Is this a case of PUSH ?

Thank you.

A: 

Push is a nice way of keeping your clients up to date, however, the more users the push server is pushing data to, the more resource intensive it gets. If this is an application where you expect to have multiple users, pushing may be a bit intensive for your needs, whereas polling regularly might be better. But give push a try, these guys (icefaces) have a nice ajax push implementation.

Hope this helps!

Scott
A: 

It seems that the server is sending its response in paginated sections. This enables the client side to begin rendering much sooner. After the client receives the first page, it renders it and begins the request for the subsequent page, and so on, until there are no more pages remaining.

Justin Johnson
A: 

You may also be interested in reading up on Comet which can be thought of as an "AJAX Push". Not sure on any PHP implementations but I know there are several other solutions out there which you could potentially tie PHP into.

houmam
A: 

I've thought about this before but never really built anything. My thought process on this was to have your script grab the latest record and get some kind of unique identifier (ID or date). You log this id with javascript and have a request try to get results that are newer than the current ID every second (or longer if you don't need the data instantly). If results are returned, you once again log the latest result for the next request.

Iainzor