One of the functions of the website i'm building is a live chat. The way I've implemented it so far is that every 2 seconds I send an ajax request that will get the 15 most recent posts (even if there weren't any posting during those last 2sec). I find it really inefficient. Is there a way to update the chat every time something is added to the database (mySQL)?
I find timers really hard to work with. Is there an alternative to it? (i'm currently using the timer plugin developed by lisaplugins --- http://jquery.lisaserver.be/timer.html) thanks for your help.