First thing came my mind also was periodically checking the server for new posts with ajax, but in my opinion it loads the server and database.
Is it actually possible to do it without periodically sending requests?
P.S.: when I wrote "in twitter and facebook" I meant them as examples)
In March 2006, software engineer Alex Russell coined the term Comet in a post on his personal blog. The new term was a play on Ajax (Ajax and Comet both being household cleaners, common in the USA).
Thxn!))) Shit, I was implementing the same thing)) well, almost the same thing))) But, in my implementation the main disadvantage is that I have to create "userID".php file for each registered user, since single php file can't process many many files simultaneously.(can it?)
flush(); // used to send the echoed data to the client
sleep(1); // a little break to unload the server CPU
So I think server should somehow check what users are logged in at every cycle, and send to them data.