I'm designing a website and for this reason I have not started writing code.
THE PROBLEM IN SYNTHESIS IS THIS:
If I have two or more(up to 500) users connected to a page that need to exchange messages without any refresh, how can I?
Initially, I immediately thought of making an ajax call every 0.2 seconds that give back to me any new messages but this solution is absolutely counterproductive.
I have read a bit on the internet but have not found an effective solution
HOW would solve:
I would make an AJAX call (with a timeout) and the php code would do for an infinite long as there are no new messages.
It could be a solution?
I have read on the Internet and there is little talk of this HTTP Long polling and I can not find a solution. can you help me?