Antwort: [Mod_gzip] Mod_gzip and mod_perl request handler

mod_gzip@lists.over.net mod_gzip@lists.over.net
Mon, 6 Jan 2003 13:37:01 +0200


Hi jann,


> I have several mod_perl scripts set up to be called (through a
request-handler in Apache) by doing the following:
> http://sitename.com/THISSCRIPT
> They are not being compressed, though--my guess is that due to
> the handler being perl-script and not cgi-script and the URI
> NOT having a .html, etc.

this would depend on your "include" rules.

> So my question is will the following do it (repeating for each script
name)
> mod_gzip_item_include         file /THISSCRIPT
> Or is it:
> mod_gzip_item_include         file ^^THISSCRIPT
> or:
> mod_gzip_item_include         file ^^THISSCRIPT$

Unfortunately, I cannot tell you this from my memory.
Apache may even overwrite the "file" parameter before
mod_gzip gets to see it. Did you try to use the "uri"
rule type instead of the "file" type in your case?

You might compile mod_gzip with full DEBUG settings,
and then run Apache in "debug" mode, then you would
see each and every internal test that is performed
by mod_gzip ...
Future versions of mod_gzip should offer some more
log file fields to display the actual values of all
the contents that are subjects of "include" rules,
but no such version has been released yet.

> Or is it better to do:
> mod_gzip_item_include         handler ^^perl-script$
> To get ALL Apache-request-handlers covered.

I would try to do it this way (if the string you
named here is the correct one), as the rule looks
simple and understandable to me (and maintenance of
the configuration _should_ be an issue).

This of course depends on what you actually want to
be compressed.

> And if it is better to do the last one (handler), what
> happens when a .cgi script which is already mapped
> using a FILE directive ALSO gets mapped using a HANDLER
> directive. Which one overrides (or, g*d forbid, does
> it attempt to compress it twice? (I would not think
> so--mod_gzip HAS to be smarter than that.)

mod_gzip is doing two phases of checks for "include"
and "exclude" rules.
     http://www.schroepl.net/projekte/mod_gzip/config.htm#filters
is explaining which rules fall into which phase.
mod_gzip will _not_ compress a resource if any of
these phases result in
 a) no "include" rule firing OR
 b) any "exclude" rule firing.
So each firing "exclude" would override any number
of "include"s. And there may be several other rea-
sons for mod_gzip to _not_ compress a response ...

And you are right, mod_gzip doesn't care how many
"include" rules are firing ... actually it will
only set something like a boolean flag for this
purpose, which will then later be checked when the
time to actually compress the data has come.
You may write redundant "include" rules; this would
only slow down the rule checking logic a little bit.

> PS:  Rhetorical (or not): Has anyone noticed that MSIE
> 5.2.2 for OS X (Jaguar 10.2) does NOT allow gzip content?
> What is the deal?  MSIE for the PC does!

Oh - this is quite a surprise for me.
Are you absolutely sure about this one?
Then I would like to include it into my documentation.

> Navigator and Mozilla do, so what is the story?

Does this UserAgent send an "Accept-Encoding" header?
What does
     http://www.schroepl.net/cgi-bin/http_trace.pl
tell you about this?

> I really want to use gzip all the time in my web server,
> but it does me as the developer no good--I see no speed
> increase...grin (never mind my visitors---who cares about
> them.  I just want to develop faster...[kidding])

Isn't there any Mozilla clone available for your platform?



Regards, Michael