Re: Gzip compressed document how?
| From: | Michael Kimsal | Date: | Thu, 03 Aug 2000 14:50:17 +0000 |
| Subject: | Re: Gzip compressed document how? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-9939@lists.php.net to get a copy of this message | ||
We just spent too much time on this yesterday. The crux is that
you need to add specific headers and footers to the gzip data -
an md5 hash (I think) and the size of the data, as well as some
other stuff which helps the browser. Try chaning gzip to 'compress'
and using M16 Mozilla - that works.
Chris Adams is apparently working on this topic and is
putting together an article about how to do this -
he posted a few days ago to the list a demo at
gzip.digitaria.com. One paragraph repeated hundreds of times
(not quite a 'real world' test, but you get the picture). About
1 meg of html gzip compressed to about 7k.
BTW, chris, I forgot to mention that it didn't work in our IE5
for some reason. ???
I think Chris may be able to shed some more light on this,
or you can wait for the article.
Wico de Leeuw wrote:
> Hiya can anybody tell me why this isn't working?
>
> <?
> strstr($GLOBALS[HTTP_ACCEPT_ENCODING], "gzip") OR die("missing
> support");
> $data = "test test test test test test test test test";
> $new_len = strlen($data = gzcompress($data, 9));
>
> Header("Content-Type: text/html");
> Header("Content-Length: $new_len");
> Header("Content-Encoding: gzip");
>
> echo $data;
> ?>
>
> Greetz,
>
> Wico
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
--
==========================
Michael Kimsal
http://www.tapinternet.com
734-480-9961