views:

74

answers:

1

Hi. I am making a web-site , which is a social network. There is need of making overall notification block/bar on the website.

User should be notified when a) there is new message b) there is new friend request c) there is new photo rating ....

As application (php/mysql) should be made with future calculation of minimum 100-1500 users online, what is the best practise to make such notificaion display? Should I make checks with each time users refresh their browser, or Jquery script which will ping the special check.php script each 10-15-20min...??? What is most professional practise ? Who can help?

+2  A: 

There are 3 things that come to mind.

1) You could try using this "push" server which holds open a connection between the browser and the APE server and pushes information to the browser when needed. Check out the APE

2) You could open up a ajax connection to the web server and make it loop. You can then check server side if there are some new notifications and if there are, then you'll "push" it (even though it's a pull :-)) to the client and kill the script. If there are no new notifications, then you'll make the script sleep for X seconds and try again.

3) This I think is the worst idea. You can use setInterval() in Javascript to make the client check for new notifications (via pulling) every X seconds. Every check makes a new http connection, which isn't really good.

Kristinn Örn Sigurðsson
APE is great thing, but I am with lack of experiense with AJAX.... :(I will try to use it..thanks
DR.GEWA