CARLI / web-reports

Web Reports Web Based Reporting Tool
2 stars 0 forks source link

Cache requested CSV file on server to prevent regeneration on subsequent downloads #129

Open patrickzurek opened 7 years ago

patrickzurek commented 7 years ago

As @csaundrs noticed, the report Bib record without UT but title contains transl (Local Cat Maint > Bibliographic Records: Titles) sometimes returns many, many rows. When the user chooses to download the CSV output, the CSV file is marshaled by the backend and then sent to the user. In the particular case I tested with an output of ~85,000 rows it took the devel backend upwards of several minutes (3-4 maybe?) to generate the csv file.

An enhancement I'd like to make is to cache the newly generated CSV file on the server so that if the user tried to download the file again, the backend would simply deliver the already created file instead of re-creating it. To be clear, the user would still have to wait for the CSV file to be generated the very first time it's downloaded. For sure, this is not a common activity for the user to perform, but the effort required to implement the caching is not great and is related to my other proposed enhancement for which I'll be creating a separate issue (#130).

@gibsonjc, @csaundrs, @dmcmpbll, @jenhm: Thoughts on this? I can't quantify the amount of time it will take to implement this except say: not long. The only other side effect is a negligible increase in disk resources.