Chat in Cakephp

Asked

Viewed 87 times

1

My colleague and I developed a chat in Cakephp 1.2 (the system is a bit old) using Ajax. But the only problem is that he needs to keep making requests to the database at all times, with a set interval, in search of new messages, more or less like a boring guy asking "Got a message? Do you have a message? Do you have a message?" and this can overload the server if it is used too much, and this method is not good practice. The interval, by the way, is very short, for a better user experience.

Anyway, I would like some functional, simple and efficient alternative. Something that, when sending a message, the bank already tells the other user "you have a message", the opposite of what happens.

I researched a lot about sockets, but did not know how to implement in the code. I also thought about doing in Angularjs, but also without success. The chat works perfectly, but has this hindrance.

I prefer to keep the details of the system secret.

If anyone knows anything, I’d be grateful.

  • Nodejs would be a good http://stackoverflow.com/questions/23619015/creating-a-private-chat-between-a-key-using-a-node-js-and-socket-io

  • Great, I’ll do a little research.

  • I’ve been doing a lot of research on how to solve the problem. I found something about Comet, the Ajax Reverse or Ajax Push, which is what the Facebook chat uses (based on my searches). My problem here is how do I implement a Comet-based tool on a Cakephp system? Even worse, I need to save all conversations in a Postgresql database, Apache server. How would I do that?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.