Answer the question
In order to leave comments, you need to log in
Is it correct to request ALL data again when changing?
I have a post with comments. In the component, I have a method that requests all post comments via ajax, after receiving them, I display them at the bottom of the post (I use : key when displaying comments). I also have events connected and when a user adds a comment, a notification will be sent from the server to other users. So, is it worth it when adding a comment from other users to re-receive post comments via ajax?
Answer the question
In order to leave comments, you need to log in
Let's assume that there are a lot of comments.
From an economic point of view, it is better to upload a separate comment.
Another thing is that this complicates the task to a degree, no matter what anyone says, when compared with a normal reboot.
Economic components:
1. The amount of information transmitted over the network.
2. It is easier for the database to return 1 record by key. (this will also save a resource)
3. There are fewer movements on the client side.
I will say this, it is better if there is a reload of one comment.
Why make another request? After all, with a notification, you can also send a new comment.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question