I built a notification system that checks whether there are new notifications every 10 seconds using the setInverval
javascript function, that sends ajax request and returns a json with the notifications.
I would like to hear alternative ways to do that, that doesn't have to be timed.
Is a while loop & a worker thread better? Since I'm working with PHP, how do I not overload the server with too many requests?
What are the security risks I am facing with my system, and with the system you'd like to suggest.