Sorry if the question is simple, I am new to web development and self-hosted servers.
We have a self hosted website, which is supposed to have a button to download a large zip file (1 GB). For this, we have a simple solution in the index.html
file:
<form action="path/to/file.zip" style="display: inline;">
<button type="submit" class="btn btn-light">DOWNLOAD</button>
</form>
This usually worked fine. The problem is, whenever multiple visitors try to download the file at the same time, the server runs out of RAM and the website crashes. This is because every time someone clicks on the download button, the file appears to be loaded on RAM during the whole download process. When multiple visitors click the Download button, the file is loaded on RAM multiple times. As additional info, the website is built with python+Flask, and the server has 12 GB of RAM.
I have seen that in this answer (How to stop Apache from crashing my entire server?) they suggest to "take load off Apache for long-running processes", but I am not sure how to achieve that. Is there any solution you can suggest to solve this problem?
Thank you very much in advance.