Re: How to count transfered kBytes in File-Download
| From: | ceo at l-i-e dot com | Date: | Mon, 05 Jan 2009 17:06:29 +0000 |
| Subject: | Re: How to count transfered kBytes in File-Download | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-285471@lists.php.net to get a copy of this message | ||
> When mentioning the RAM usage problem, one might consider calling
> flush() after each echo, just to make sure that they don't run over
> PHPs memory limit.
Oh yeah.
Make sure you've run through and cleared all ob_buffers for any kind of non-HTML output,
specifically for file downloads.
You really don't want your web server buffering up a potentially large streamable content just
because you've got ob_auto_start or whatever in php.ini, or some kind of main controller
calling ob_start() or whatever.
I know a lot of folks swear by ob_start and its benefits, but I mostly find it annoying as a general
"solution"...
Didn't even think of that, as I only use ob_start() when I *really* want it, not as a general
fix-up.