I need some advice on a problem/ implementation. So my platform has a page where a user can download a PDF report of all there added data. The data downloads into a tables layout and is paginated etc and at the bottom of each page there is totals, totals from previous pages and grand totals which is fetched from the indidual added data as in the picture. Now the problem occurs when a user has maybe 5000+ entries which will generated a pdf report of nearly 1000 pages. For each new page (counter system) then multiple queries happen to get relevant data for that particular page. If a user does have like 5000+ records then the server will just come back with a NGINX 404 not found error after like 45 seconds or something.
So I am wondering what things I can try to stop this happening, I have tried adding usleep() around all the queries to stop it spamming the DB but that doesn't seem to work. Hosted on AWS
I know not much information about bit can add more information if required
Thanks
