Re: gzip-based html compression
| From: | Zeev Suraski | Date: | Wed, 28 Jun 2000 17:50:57 +0000 |
| Subject: | Re: gzip-based html compression | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-3608@lists.php.net to get a copy of this message | ||
You can do that pretty much transparently today(*), using the following
code:
prepend.inc.php:
<?
ob_start();
header("Content-type: text/x-gzip-compressed"); // I don't really
remember what this line should really look like, this is just the general
idea
?>
append.inc.php:
<?
$content = ob_get_string();
ob_end_flush();
print gzcompress($content);
?>
Zeev
(*) Requires PHP 4.0
On Wed, 28 Jun 2000, Sebastian Bergmann wrote:
> Hi,
>
> today I came across the following on freshmeat.net:
>
> "AlgART HTML Packer (AHP) allows you to reduce the download time of
> your Web site by 2-10 times. It does this via automatic, dynamic
> compression of all Web pages of your site with use of the standard
> "GZip-Encoding". Packing speed is about 200-500 Kb/sec on
> Pentium-200. The unpacking takes virtually no time. It works on both
> Apache and MS IIS."
>
> I understand that the "major" browsers (Netscape Navigator (Mozilla?),
> MS Internet Explorer, ...) support the transport of gzip-compressed HTML
> pages through HTTP.
> Sadly I was not able to find information on this standard on w3.org.
>
> I'd like to write, if possible, a small library in PHP that sends the
> output of PHP scripts gzip-compressed, if the visitor's browser supports
> this.
>
> Just a thought,
> Sebastian
>
>
--
Zeev Suraski <zeev@zend.com>
http://www.zend.com/