I am confused, what is the cron job actually doing, is it somehow directly interfacing with the client, or updating a database?
I have no idea, can you clarify what that is?
We all know what a cron job is
Clearly, dchuk, you are mistaken. I was responding to the question posed by mattseh about a cron job.
As well, everything depends on your setup, and the way you are configuring the system. The OP was proposing creating a script that was running every 1 second on the server. Talk about taxing the system. If they are looking for that type of response, it should only run when a client is actually on the system, otherwise, it will be taxing itself during nights, etc. So, logically Ajax was one of the best options to ask every, X amount of seconds whether there is a new message, instead of the server writing to a db, every second forever, even if there is no body on the server. The first response was an Ajax solution, so I continued along that line.
My 1/1000 seconds was more of a "IF YOU REALLY WANT TO" statement, as you can see from the next statement "(if your server can handle it)". I would recommend setting it for 10 sec, or so. Who really needs a notification in under 10 seconds anyway?
Your websockets solution may very well be the most practical solution. I haven't take the time to explore websockets route since the turn of the century (Could have been a different type of socket, some SOAP thing-a-majig, so I cannot make an educated comment on it.
"Be cool bro, Be cool bro, we're all on the same side here..."