Re: Compression
| From: | Sascha Schumann | Date: | Sun, 23 Jul 2000 21:49:45 +0000 |
| Subject: | Re: Compression | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-7787@lists.php.net to get a copy of this message | ||
On Sun, 23 Jul 2000, Matthias Schniedermeyer wrote:
> #include <hallo.h>
>
>
>
>
>
> > > > Make sure you check that the browsers accept that encoding.
> > > >
> > > > As far as I know, only the latest versions of netscape and the the past
> > > > few of IE allow that ;O)
> > >
> > > $HTTP_ACCEPT_ENCODING
> > >
> > > Thats the smallest problem, if i can send all output compressed.
> >
> > Can you use the gzopen, gzputs and redirect to the new file you created?
> >
> > The server will have to work a little more but it will save you in bandwith
> > ;O)
>
> Very unelegand. The "beautifullest" way IMHO is (Perl-Syntax!)
>
> if ($HTTP_ACCEPT_ENCODING ~= /gzip/)
> {
> send_output_compressed(gzip,<Compression_Level>);
> }
Content encoding is the job of the webserver, not the
language. Additionally, you should not expect everyone to use
the latest browsers. Some versions of MSIE are known to send
the "Accept-Encoding: gzip" header, but fail to decode the
HTTP-compliant reply properly.
- Sascha