RE: [PHP] HTTP compression

From: Date: Sun, 04 Feb 2001 14:15:46 +0000
Subject: RE: [PHP] HTTP compression
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-38107@lists.php.net to get a copy of this message
Rasmus, Thanks for the clarification; it seems obvious, too, that mixing compressed and non compressed content would be quite difficult to implement; at least it would partially compromise the speed/size gain because of added protocol overhead. Now, imagining that we have enabled compression by calling ob_start("ob_gzhandler"), what happens for a document that contains something along these lines: <!-- snip --> ... <? // Enable HTTP compression ob_start("ob_gzhandler"); // PHP content $content = "This is some content."; ?> <div>This is a normal HTML section</div> <? // PHP content continues $content .= "And the rest of it."; echo $content; ?> ... <!-- snip --> In this particular case, what would be compressed ? As far as I have understood, nothing at all, because some part of the output is not "passing through" PHP, right ? > -----Message d'origine----- > De : Rasmus Lerdorf [mailto:rasmus@php.net] > Envoye : dimanche 4 fevrier 2001 14:34 > A : Alain Fontaine > Cc : php-general@lists.php.net > Objet : Re: [PHP] HTTP compression > > > > I've just started experimenting with ob_start("ob_gzhandler") a > bit, and I > > have found that if any output is generated before ob_start() is called, > > nothing at all gets compressed; if ob_start() is called before > any output, > > everything is compressed. > > > > Is this the case, I mean, is this "by design" ? > > Yes, it wouldn't really work any other way. You can't mix non-compressed > and compressed in the same request. > > -Rasmus > >

« previous php.general (#38107) next »