seblucas / cops

Calibre OPDS (and HTML) PHP Server : web-based light alternative to Calibre content server / Calibre2OPDS to serve ebooks (epub, mobi, pdf, ...)
http://blog.slucas.fr/en/oss/calibre-opds-php-server
GNU General Public License v2.0
1.43k stars 229 forks source link

Update fetch.php to lower memory consumption #518

Closed allandanton closed 1 year ago

allandanton commented 2 years ago

On big eBooks like comic books you can hit the PHP memory limit. With this changes there is no need to raise the memory limit in php.ini. Also readfile is recommended in the php documentation instead of fpassthru for most cases so I changed it. Also if you download binary data make sure that there is no output after that therefore an explicit exit() at the end.

mikespub commented 1 year ago

Included in #522 and release 1.2.2 at https://github.com/mikespub-org/seblucas-cops