1 person found this helpful
What you need is probably long polling. Make a request server helds it and then
send back the message only when it has an update. Then client knows it needs to
poll for the update. Not sure how to implement with php did not try it.
You are right about scaling. Poll scales better than push. The question is are
you able to throw in more hardware when the solution does not scale good enough?
On the other hand if you decide to go with poll I would only make calls on an
simplified url something that returns a Boolean hasNewData or as small as
possible. Depends on the data you need to check for updates: If more than have
more flags ... If has new data is true you make a call for the update you need.
That way you only exchange minimum data over the network.
Thanks for your input!
I've had a look at PHP long polling and it seems a bit tough to implement it. Anyone out there with a succesful PHP long polling setup? I've done a fair amount of googling on the subject and found nothing interesting...
Ok, so I guess PHP is not the best language for this kind of interactions. To bad I'm not a Java guru I'd just use BlazeDS or something like that.
I'll probably try implement some kind of intelligent polling system where the frequency will depend on current the view, number of concurrent users and so on...