[Mod_gzip] Mod_gzip and mod_perl request handler
Jann Linder
mod_gzip@lists.over.net
Mon, 16 Dec 2002 22:56:09 -0800
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.
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$
Or is it better to do:
mod_gzip_item_include handler ^perl-script$
To get ALL Apache-request-handlers covered.
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.)
I have mod_gzip set up as the following:
<IfModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_can_negotiate Yes
mod_gzip_static_suffix .gz
AddEncoding gzip .gz
mod_gzip_update_static No
#mod_gzip_command_version '/mod_gzip_status'
mod_gzip_temp_dir /tmp
mod_gzip_keep_workfiles No
mod_gzip_minimum_file_size 500
mod_gzip_maximum_file_size 500000
mod_gzip_maximum_inmem_size 60000
mod_gzip_min_http 1000
mod_gzip_handle_methods GET POST
# Before version 1.3.19.2a this value was not configurable.)
mod_gzip_item_exclude reqheader "User-agent: Mozilla/4.0[678]"
mod_gzip_item_include file \.html$
mod_gzip_item_include file \.shtml$
mod_gzip_item_include file \.htm$
mod_gzip_item_include file \.shtm$
mod_gzip_item_include file \.php$
mod_gzip_item_include file \.phtml$
mod_gzip_item_exclude file \.js$
mod_gzip_item_exclude file \.css$
mod_gzip_item_include file \.pl$
mod_gzip_item_include file \.cgi$
mod_gzip_item_include file \.cgix$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^text/html$
mod_gzip_item_include mime ^text/plain$
mod_gzip_item_include mime ^httpd/unix-directory$
mod_gzip_item_exclude mime ^image/
mod_gzip_dechunk Yes
mod_gzip_add_header_count Yes
# The following Yes was changed to On per the newest doc changes
# submitted to the list in December:
mod_gzip_send_vary On
</IfModule>
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! Navigator and Mozilla do, so what is the story? 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])
--
Mr. Jann Linder
Director of Internet Development
DinnerBroker/Pricing Dynamics, Inc.
San Francisco, CA
1-888-iEATat8 x235