javascript - Laravel backend, Vue frontend, api best practises?

one text

Solution:

Data repetition is not an issue normally unless you have big data with too many repetitions. The problem would be the number of queries and total usage of memory if your concern is performance. To check them you can use Laravel Debugbar.

Actually, if you fetch users separately, you will execute too many extra queries, which will decrease the performance.

If you plan fetching user data when the conversation is displayed, it will increase the page load performance due to the smaller data size, but in this case, your server will have to respond to too many extra requests, which can create other performance issues.

So, as always, it depends...

Personally, I always start with the data that is absolutely necessary. All other things can be delivered by request or time. So, the 2nd option looks better.

Source