Is doing setInterval on the frontend a very very bad thing to do, to then check for new data? What is the best way to do this? How do you check for differences? Do you handle this on the server?
i once asked this question. Here were the replies
Look at pusher.com for a premium option (they have a free plan for development). Or if you would rather roll your own for free, check out socket.io.
Both options make use of WebSockets.
Marco Alka
Software Engineer, Technical Consultant & Mentor
In addition to
setIntervalfor polling data, you can either do it the classic way and use long-polling AJAX calls, or you go for a different idea, which I personally prefer: Have the server push data over WebSockets.setIntervalwill limit you to specific points in time. If you are (or rather your customer is) OK with it, you can go with it. The important part is to get the job done in the best way possible and I do not see whysetIntervalmight be a bad choice in certain cases.