I am in the process of developing a live chat system for my website, but I am uncertain about the best approach to take. Initially, I planned on using an AJAX request to retrieve the chat log at set intervals, which seems to be a common method based on various tutorials.
However, I have concerns that this approach may lead to unnecessary or rapid consumption of my server's resources. I want to ensure that my chat system is reliable and up-to-date. Therefore, my question is: What is the ideal interval in milliseconds between each ping to balance resource usage without compromising accuracy in recording the chat log?