RE: [PHP] Gzipped output
| From: | Andrés Robinet | Date: | Sun, 10 Feb 2008 19:20:50 +0000 |
| Subject: | RE: [PHP] Gzipped output | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-269054@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: Jakub [mailto:ja.cermi@centrum.cz]
> Sent: Sunday, February 10, 2008 1:36 PM
> To: php-general@lists.php.net
> Subject: Re: [PHP] Gzipped output
>
> That would do the trick if it was allowed at the server .... but it
> isn't :( And it's not my server and I can't change its settings.
>
> Jakub Čermák
> ja.cermi@centrum.cz
> ICQ 159971304
>
>
>
> Per Jessen napsal(a):
> > Jakub wrote:
> >
> >
> >> Yes, I thought about this, but this has a big disadvantage - the
> >> client must wait for the file to be fully processed and compressed and
> >> then he can start downloading. I'd like to let the client start
> >> downloading the compressed parts while the further parts are still
> >> being processed and compressed - it's similar to streaming concept. I
> >> hope you can see what I mean.
> >>
> >
> > Maybe apaches mod_deflate is what you're after? That will do in-flight
> > compression.
> >
> >
> > /Per Jessen, Zürich
How about something like this? (Needs debugging and testing, but... just a hint after all)
<?php
ob_start("ob_gzhandler");
while ($someString = getTheNextPartOfTheLargeFile()) {
echo $someString;
ob_flush();
}
?>
Regards,
Rob
Andrés Robinet | Lead Developer | BESTPLACE CORPORATION
5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4207 |
FAX 954-337-2695 |
Email: info@bestplace.net | MSN Chat: best@bestplace.net | SKYPE: bestplace | Web: bestplace.biz
| Web: seo-diy.com