Antwort: Re: [Mod_gzip] SEND_AS_IS:HAS_CE message

Jack Wang mod_gzip@lists.over.net
Sat, 3 May 2003 14:47:12 +0800


Hi Michael and Stephen,

Thanks for your reply.


> Hi all:
>
> PHP does have Content Compression built into it. I have an entire paper
> on PHP compression at http://www.webcompression.org/php-compress.html.
>

Thanks.  I have read it. Very good.

> Three lines in the php.ini file that you need to be concerned about:
>
> Method 1:
>
> output_buffering = On
> output_handler = ob_gzhandler
> zlib.output_compression = Off

Here is the result status by method 1;

A) GET /liwen/index.htm HTTP/1.1" 200 808 mod_gzip: OK In:572 -< Out:380 =
34 pct.

B) GET /index.php?file=company/contact.html HTTP/1.1" 200 17993 mod_gzip:
     SEND_AS_IS:HAS_CE In:0 -< Out:0 = 0 pct.

C) GET /liwen/php/mail.php HTTP/1.1" 200 818 mod_gzip: SEND_AS_IS:HAS_CE
In:0 -< Out:0 = 0 pct.

D) GET /phpMyAdmin/main.php?lang=zh-tw&convcharset=iso-8859-1&server=1
HTTP/1.1"
     200 3967 mod_gzip: SEND_AS_IS:HAS_CE In:0 -< Out:0 = 0 pct.


>
> Method 2:
>
> output_buffering = Off
> output_handler =
> zlib.output_compression = On

Here is the result staus by method 2;

 A) GET /liwen/index.htm HTTP/1.1" 200 - mod_gzip: SEND_AS_IS:NO_200
      In:0 -< Out:0 = 0 pct.

 B) GET /index.php?file=company/contact.html HTTP/1.1" 200 18263 mod_gzip:
      SEND_AS_IS:HAS_CE In:0 -< Out:0 = 0 pct.

 C) GET /liwen/php/mail.php HTTP/1.1" 200 818 mod_gzip: SEND_AS_IS:HAS_CE
      In:0 -< Out:0 = 0 pct.

 D) GET /phpMyAdmin/main.php?lang=zh-tw&convcharset=iso-8859-1&server=1
HTTP/1.1"
      200 4079 mod_gzip: SEND_AS_IS:HAS_CE In:0 -< Out:0 = 0 pct.

Transparently, Gzip didn't compress PHP code by Method 1 and 2.  BTW, Gzip
didn't compress HTM by Method 2 (Method 2A).

Here is my part of mod_gzip.conf.

mod_gzip_item_include         file       \.html$
mod_gzip_item_include         file       \.htm$
mod_gzip_item_include         file       \.php$
mod_gzip_item_include         file       \.php3$
mod_gzip_item_include         file       \.txt$
mod_gzip_item_include         file       \.pdf$
mod_gzip_item_include         file       [^.]*$
mod_gzip_item_include         file       \.js$
mod_gzip_item_include         file       \.css$
mod_gzip_item_include         file       \.pl$
mod_gzip_item_include         handler    ^cgi-script$
mod_gzip_item_include         handler    ^perl-script$
mod_gzip_item_include         mime       ^text/html$
mod_gzip_item_include         mime       ^text/plain$
mod_gzip_item_include         mime       ^application/pdf$
mod_gzip_item_include         mime       ^httpd/unix-directory$
mod_gzip_item_include         mime       ^application/postscript$
mod_gzip_item_include         mime       ^application/ms.*$
mod_gzip_item_include         mime       ^application/vnd.$
mod_gzip_item_include         mime       ^application/x-httpd-php$
mod_gzip_item_exclude        mime       ^application/x-javascript$
mod_gzip_item_exclude        mime       ^image/.*$
mod_gzip_dechunk              Yes


Might my configuration be wrong ?! Any comment ? Thanks in advance.

>
> In your case, setting "output_buffering = Off" will turn off the PHP
> compression.
>
> I handle all compression through mod_deflate/mod_gzip, but there is
> NOTHING wrong with PHP handling compression for PHP files. It just means
> that mod_deflate/mod_gzip doesn't NEED to compress the data.
>
> Just my two cents worth.
>
> smp
>
> Michael.Schroepl@telekurs.de wrote:
> > Hi Jack,
> >
> >
> >
> >>output_handler = ob_gzhandler
> >
> >
> > this one is known to provide gzip compression for PHP
> > scripts - but don't ask me how to configure or even
> > disable it.
> > As Kevin pointed out, you may want to comment this out.
> >
> >
> >>PS: I have enabled Zend Opertmizer.
> >
> >
> > Heureka.
> >
> > Please read
> >      http://www.zend.com/zend/art/buffering.php
> > where Zend documents their procedure how to serve PHP
> > output in compressed form. (Unfortunately, they don't
> > use link targets inside their documents ...)
> >
> > You don't have any problem at all, except for not reading
> > the documentation of the suite of software that you are
> > using (which includes
> >
http://www.schroepl.net/projekte/mod_gzip/status.htm#SEND_AS_IS:HAS_CE
> > as well), and thus wondering what their diagnostic output
> > means.
> > After all, who cares which of your modules actually does
> > the compression, as long as any one does it?
> >
> > Regards, Michael
> >
> >
> >
> > P.S.: It took me about 30 seconds to ask Google for
> >
> >       "Zend gzip"; the above link is the _first_ hit.
> >
> >
> > _______________________________________________
> > mod_gzip mailing list
> > mod_gzip@lists.over.net
> > http://lists.over.net/mailman/listinfo/mod_gzip
> >
> >
> >
>
> --
>
> ****
>
> Stephen Pierzchala
> stephen@pierzchala.com
> http://www.performanceguru.com/
>
> _______________________________________________
> mod_gzip mailing list
> mod_gzip@lists.over.net
> http://lists.over.net/mailman/listinfo/mod_gzip
>