Zip file creating makes the server run out of memory, when there's too much data
The currently used Zip-Creation uses the machines' memory in order to create a zip file. This will make the request fail, if too much memory is used. We'll get an exception of this kind:
[2021-06-16 09:04:40] prod.ERROR: Allowed memory size of 134217728 bytes exhausted (tried to allocate 3768584 bytes) {"userId":1,"exception":"[object] (Symfony\\Component\\Debug\\Exception\\FatalErrorException(code: 1): Allowed memory size of 134217728 bytes exhausted (tried to allocate 3768584 bytes) at /var/www/app/server/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:147)
[stacktrace]
#0 {main}
"}
Solution:
- Write the zip to a file.
- Redirekt the user to the file.
- Delete the zipfile after this or after some time (I think Laravel has tools for that...)
Related: a247c7ce