0
votes

In my vuejs application, on my page, I want to display a list of clients and when individual client row is expanded, then expand that row to show a list of proposals for those client. There is also an expand/collapse all functionality for all clients (table level), where all the clients get expanded/collapsed. The issue here is, the entire dataset is very heavy and the initial load time required to fetch entire client plus proposals data is huge.

To avoid this performance issue, I am only loading a list of all clients first on initial load. When an individual item is clicked, the proposal item component does an axios call and fetches the proposal data for itself.

Only issue in above scenario is, since the number of clients are too huge for a user, the expand all will result into too many ajax requests from component instances and browser is sometimes not able to throttle it.

Please advise a proper solution for above use case.

1
You should commence the download of a subset of the user data as soon as possible in background for the user over the fold and keep downloading data as they are viewed. Let's say you fetch just a couple of dozens of data row at once, or a hundred of them, and keep downloading and visualizing as the user scroll down. - Eineki

1 Answers

0
votes
  1. Add feature to your server, which will be generate data and send only one huge data (it will decrease delay, because creating new request from client and connecting throw tcp is taking much time)
  2. Add loading window/spinner and set delay between requests By the way it depends on your requests count.