It seems to me or AJAX on Habré does not cope with the main task entrusted to this technology, namely to minimize the amount of information transmitted between the browser and the server? Why, one wonders, if I write 1 comment in the comment tree, which has grown to half a megabyte, I have to wait until this tree is ALL WHOLE reloaded? I, for example, at work, the Internet has a speed of 3 kilobytes per second, what do you think, how long does a tree update in this case?
How do I see the way out?
1. Send a comment to the server and the
time or identifier of the newest message in the already loaded tree.
2. Add it to the tree (already on the server).
3. Send back only the difference of trees (new messages) and insert them in the right places on the client side.
In the current implementation, I do not see the benefits of using AJAX, well, the live broadcast and CloudTeg do not load once again, so what? With such volumes of the topic, they no longer play a role. And then there are topics and a half megabyte of discussion and more.
You should also add the “update” button, which will launch the same procedure as when sending a message, but without the message itself.