leepeuker / movary

Self hosted web app to track and rate your watched movies
MIT License
401 stars 14 forks source link

Improve dashboard (rows) performance #394

Open leepeuker opened 1 year ago

leepeuker commented 1 year ago

Currently when loading the dashboard we are fetching the data for all possible dashboard rows regardless of which rows are really shown in the frontend.

Loading all rows immediately improves loading times during dashboard usage

JVT038 commented 1 year ago

Would this mean that the dashboard row data would only be loaded when the user unfolds / extends the row?

leepeuker commented 1 year ago

Yeah good question. I was thinking to still keep it in the backend, so only to remove the data for the rows wich are not rendered.

We could move the data fetching into js frontend, but that would mean we have to render the html in the frontend too. This would probably the the best thing to do, but requires the most change effort.

JVT038 commented 1 year ago

It shouldn't be that difficult right?

Just add an event listener to check whether the user has extended the rows and if yes, add a loading spinner and make a POST request in the background to the backend, to fetch the data. When the data has arrived, remove the spinner and manipulate the DOM to inject the requested data.

leepeuker commented 1 year ago

I did not say that it is difficult, but it takes time