Antwort: RE: [Mod_gzip] simple question
mod_gzip@lists.over.net
mod_gzip@lists.over.net
Tue, 19 Nov 2002 01:04:45 +0200
Hi Matt,
> <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_item_include file \.html$
> mod_gzip_item_exclude file \.js
> ...
> </IfModule>
>
> If I am excluding .js extension but set can_negotiate to true, and there
are
> the following files: file1.js, file1.js.gz, file2.js
> And I request file1.js and file2.js will I get only file1.js.gz as a
compressed
> file? Or will the exclude cancel that?
the latter one is true.
mod_gzip will first detect whether to sent the content in compressed
form, and only if it decided to do so, it will try to find out how
to do this, which would _then_ include checking whether a static
version is to be served.
Actually, sending .js files in compressed form is a very nice way to
blow Netscape 4 up. So be sure to take care of this problem.
> Hope that make sense, I am looking to compress a given extension only is
> there is a static version.
This is nothing mod_gzip is prepared to do. If you want to send the
file in compressed form, then mod_gzip will be willing to do it on
runtime, unconditionally.
What you actually seem to need is not mod_gzip, but rather plain old
Content Negotiation with Apache's own modules - you can handle your
problem with that alone.
Unless, of course, you want to get the gzipped content be maintained
automatically - in which case even gzip_cnc might be the tool of your
choice ... this will handle static files only but care for the com-
pression on its own.
I believe mod_gzip will get you nowhere in your special case.
Regards, Michael