HajraAJAX does not cope with the task?
It seems to me that AJAX on Habr is not coping with the main task assigned 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, should I wait until this tree is REALLY rebooted ALL? For example, at my place, the Internet has a speed of 3 kilobytes per second at work, how long do you think the tree is updated in this case?
How do I see a way out of the situation?
1. Send to the server a comment 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 it on the client side in the right places.
In the current implementation, I do not see the benefits of using AJAX, well, live broadcast and CloudTags are not loaded once again, so what? With such volumes of the topic, they no longer play a role. And then there are topics and a half megabytes of discussion and more.
You should also add the “update” button, which will start the same procedure as when sending a message, but without the message itself.
How do I see a way out of the situation?
1. Send to the server a comment 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 it on the client side in the right places.
In the current implementation, I do not see the benefits of using AJAX, well, live broadcast and CloudTags are not loaded once again, so what? With such volumes of the topic, they no longer play a role. And then there are topics and a half megabytes of discussion and more.
You should also add the “update” button, which will start the same procedure as when sending a message, but without the message itself.