Posted by Chung Leong on 11/16/05 01:00
As I've said a number of times, don't use a PHP script to serve
downloads of large files. The reasons are:
1) The web server can do it much more efficiently. Each instance of PHP
takes up quite a lot of memory. There's also quite a lot of double
copying as the data travels through different layers.
2) The web server knows how to handle partial retrieval--needed for
resuming interrupted downloads and quick navigation through large PDF
files.
3) Earlier versions of the Apache 2 SAPI module leaks memory, losing
every byte output by PHP. A rapid sequence of multi-megabyte downloads
will consume all available memory, leading to a server crash.
Getting back to your original question, you need to send the
Content-Length header.
[Back to original message]
|