Swiss-Polar-Institute / project-application

Application to track proposals and projects from their submission to finalisation
MIT License
7 stars 4 forks source link

Performance of the project grant management page get slower when more files are attached in the project #470

Closed cpina closed 1 year ago

cpina commented 2 years ago

The grant management page (e.g. ¡/logged/grant-management/project/40) gets slower as there are more files attached in the deliverables. Even the "Finance" tab gets slower with more Deliverables attached.

By file attached can be any media (photos), invoices, scientific reports, financial reports.

The reason is that for each file Django is going to the object storage and gets the file size (and checks that the file exist). The flie size is displayed as information to the user.

I think that as it gets slow this should be replaced with something better like not displayed the file sizes, or storing (and using) them from the database so it would be fast again. Another option would be to decouple the "Finance" and the "Deliverables" (using htmx?) loading the "Deliverables" only on clicking the tab. Or requesting the file sizes asynchronously from the browser.