Re: [PHP4BETA] Output compression
| From: | Christian Schneider | Date: | Sat, 13 Nov 1999 14:50:55 +0000 |
| Subject: | Re: [PHP4BETA] Output compression | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-6179@lists.php.net to get a copy of this message | ||
Joey wrote:
> I believe that's already been done?
> http://www.php.net/manual/ref.zlib.php3
Ok, simple background info to avoid confusion with zlib-Support:
HTTP allows for data sent over the net to be encoded, one of the possible
Content-encoding: types is gzip. Browsers transparently decompress the content
before displaying it.
Idea: A large amount of data sent out from our site is html text. Generally it
can be compressed by a factor of 4. To save bandwidth I want to live-compress
the php-generated html page on our side. Decompression on the other side is
automatic.
Real-world: Content-encoding: gzip is only done if the browsers sends the
Accept-encoding: .*gzip.* header and 95% of the current browsers (i.e. Netscape
>= 3 and IE >= 4) support this.
Advantage: Less bandwidth used, shorter transfer times over slow connections.
Disadvantage: More CPU needed on server side. Decompression on client side is
not really an issue.
But nowadays it's much easier and less expensive to have a faster server than to
have a faster connection so compression makes sense IMHO.
- Chris
--
Chris Schneider, mailto:cschneid@relog.ch
Computers are not intelligent. They only think they are.