Welcome to MobyThreads.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in
All support for the MobyThreads Threaded phpBB MOD can now be found on welsolutions at this forum

mod_deflate config question

 
   Web Hosting and Web Master Forums (Home) -> Apache RSS
Next:  1) How to force an https login, and 2) Using mult..  
Author Message
jbrady1

External


Since: Mar 04, 2004
Posts: 5



(Msg. 1) Posted: Mon Sep 27, 2004 4:13 pm
Post subject: mod_deflate config question
Archived from groups: alt>apache>configuration (more info?)

On my old server I have apache 1.3.31 with mod_gzip to save on
bandwidth, it's running on Redhat. I got a new dual processor system to
replace the old tired one. I wanted to go with apache 2 also with
redhat. Everything works as it should, mostly.

The problem:

The site pumps some zip archives through a php page that sends the
correct headers for the zip archives. On the old system those zipped
archives being pumped through php work as expected.

However, on the new system, zipped archives pumped through the same php
page get gzipped on top of their existing compression and once they
reach the users, they're unusable.

mod_gzip's configuration does not mention anything about zip files or
even those delivered through php, yet, they don't get re-compressed.
mod_deflate on the other hand re-compresses them.

How do I get mod_deflate to ignore files delivered via a php page (with
a .php extension of course) that have 'application/zip' for mime type?
Also, is there a way to get mod_deflate to compress some files according
to their filename extension?

Below is both servers config for mod_gzip and mod_deflate.

TIA


The configuration of mod_gzip on apache 1.3 is:

<IfModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_update_static No
mod_gzip_dechunk Yes
mod_gzip_minimum_file_size 300
mod_gzip_maximum_file_size 500000
mod_gzip_maximum_inmem_size 60000
mod_gzip_keep_workfiles No
mod_gzip_temp_dir /tmp
mod_gzip_item_include file \.html$
mod_gzip_item_include file \.htm$
mod_gzip_item_include file \.jsp$
mod_gzip_item_include file \.php$
mod_gzip_item_include file \.pl$
mod_gzip_item_include mime ^text/.*
mod_gzip_item_include mime ^application/x-httpd-php
mod_gzip_item_include mime ^httpd/unix-directory$
mod_gzip_item_include handler ^perl-script$
mod_gzip_item_include handler ^server-status$
mod_gzip_item_include handler ^server-info$
mod_gzip_item_exclude file \.css$
mod_gzip_item_exclude file \.js$
mod_gzip_item_exclude mime ^image/.*
mod_gzip_item_exclude mime ^text/sql$
mod_gzip_item_exclude file \.sql$
</IfModule>

The configuration of mod_deflate on apache 2.0.51 is:

DeflateCompressionLevel 9

<Directory />
SetOutputFilter DEFLATE
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/css
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.(?:exe|t?gz|zip|bz2|sit|rar)$ no-gzip
dont-vary
Header append Vary User-Agent env=!dont-vary
</Directory>


--
J Brady

 >> Stay informed about: mod_deflate config question 
Back to top
Login to vote
hans1

External


Since: Mar 29, 2004
Posts: 672



(Msg. 2) Posted: Tue Sep 28, 2004 1:11 am
Post subject: Re: mod_deflate config question [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Jonathan Brady" <jbrady.TakeThisOut@removethisspamkiller.myfmail.com> schreef in
bericht news:cj9hnt027sh@news3.newsguy.com...
 > mod_gzip's configuration does not mention anything about zip files or
 > even those delivered through php, yet, they don't get re-compressed.
 > mod_deflate on the other hand re-compresses them.
 > <Directory />
 > SetOutputFilter DEFLATE
'SetOutputFilter DEFLATE' causes everything to be (re)compressed, where
AddOutputFilterByType DEFLATE text/html does a mime-type selective job.
Both <a style='text-decoration: underline;' href="http://httpd.apache.org/docs-2.0/mod/core.html.en#setoutputfilter" target="_blank">http://httpd.apache.org/docs-2.0/mod/core.html.en#setoutputfilter</a> and
<a style='text-decoration: underline;' href="http://httpd.apache.org/docs-2.0/mod/core.html#addoutputfilterbytype" target="_blank">http://httpd.apache.org/docs-2.0/mod/core.html#addoutputfilterbytype</a>
does a poor job documenting this ...

 > AddOutputFilterByType DEFLATE text/html
 > AddOutputFilterByType DEFLATE text/plain
 > AddOutputFilterByType DEFLATE text/css
You could combine the three AddOutputFilterByType to a single line by
listing multiple mime-type.

HansH<!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: mod_deflate config question 
Back to top
Login to vote
jbrady1

External


Since: Mar 04, 2004
Posts: 5



(Msg. 3) Posted: Tue Sep 28, 2004 4:37 am
Post subject: Re: mod_deflate config question [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Mon, 27 Sep 2004 16:11:44 -0400, HansH wrote
(in article <cj9s61$sqi$1@news.cistron.nl>):

 > "Jonathan Brady" <jbrady RemoveThis @removethisspamkiller.myfmail.com> schreef in
 > bericht news:cj9hnt027sh@news3.newsguy.com...

  >> mod_gzip's configuration does not mention anything about zip files or
  >> even those delivered through php, yet, they don't get re-compressed.
  >> mod_deflate on the other hand re-compresses them.
  >> <Directory />
  >> SetOutputFilter DEFLATE

 > 'SetOutputFilter DEFLATE' causes everything to be (re)compressed, where
 > AddOutputFilterByType DEFLATE text/html does a mime-type selective job.
 > Both <a style='text-decoration: underline;' href="http://httpd.apache.org/docs-2.0/mod/core.html.en#setoutputfilter" target="_blank">http://httpd.apache.org/docs-2.0/mod/core.html.en#setoutputfilter</a> and
<font color=purple> > <a style='text-decoration: underline;' href="http://httpd.apache.org/docs-2.0/mod/core.html#addoutputfilterbytype</font" target="_blank">http://httpd.apache.org/docs-2.0/mod/core.html#addoutputfilterbytype</font</a>>
 > does a poor job documenting this ...

Actually the poorest part in the documentation is the various syntaxes
of various controls.

 > AddOutputFilterByType DEFLATE text/html

This is match by mime type, the filter is before the mime type to be
matched.

 > BrowserMatch ^Mozilla/4 gzip-only-text/html

This is for browser filtering, the filter is after the browser to be
matched.

 > SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary

This is to match by server environment (requests), who know what goes
where and who goes first.

 > Header append Vary User-Agent env=!dont-vary

What is this one? I don't understand what it means and why it should be
there.

If all are for mod_deflate, how come they don't have a unified syntax
and a unified documentation?

Is there a single place where all possible filters and matching methods
are listed and documented? I tried to find it but couldn't, so a pointer
would be most excellent.

Would the following filter work in stopping mod_deflate from gzipping
files with mime type 'application/zip'? (I don't have a windows system
with IE handy to test the server config; from the reports that I got,
it's the only one exhibiting the problem).

SetOutputFilter DEFLATE
AddOutputFilterByType no-gzip application/zip

  >> AddOutputFilterByType DEFLATE text/html
  >> AddOutputFilterByType DEFLATE text/plain
  >> AddOutputFilterByType DEFLATE text/css
 > You could combine the three AddOutputFilterByType to a single line by
 > listing multiple mime-type.

Thanks, done.

--
J Brady<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: mod_deflate config question 
Back to top
Login to vote
hans1

External


Since: Mar 29, 2004
Posts: 672



(Msg. 4) Posted: Wed Sep 29, 2004 3:13 am
Post subject: Re: mod_deflate config question [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Jonathan Brady" <jbrady.TakeThisOut@removethisspamkiller.myfmail.com> schreef in
bericht news:cjata302sh0@news2.newsguy.com...
 > On Mon, 27 Sep 2004 16:11:44 -0400, HansH wrote
 > (in article <cj9s61$sqi$1@news.cistron.nl>):
  > > 'SetOutputFilter DEFLATE' causes everything to be (re)compressed, where
  > > AddOutputFilterByType DEFLATE text/html does a mime-type selective job.
<font color=green>  > > Both <a style='text-decoration: underline;' href="http://httpd.apache.org/docs-2.0/mod/core.html.en#setoutputfilter</font" target="_blank">http://httpd.apache.org/docs-2.0/mod/core.html.en#setoutputfilter</font</a>>
and
<font color=green>  > > <a style='text-decoration: underline;' href="http://httpd.apache.org/docs-2.0/mod/core.html#addoutputfilterbytype</font" target="_blank">http://httpd.apache.org/docs-2.0/mod/core.html#addoutputfilterbytype</font</a>>
  > > does a poor job documenting this ...
 > Actually the poorest part in the documentation is the various syntaxes
 > of various controls.
  > > AddOutputFilterByType DEFLATE text/html
 > This is match by mime type, the filter is before the mime type to be
 > matched.
Rather, you specify an operation condition to an already hooked filter, that
filter has a preset place within the process of hanling a request.

  > > BrowserMatch ^Mozilla/4 gzip-only-text/html
 > This is for browser filtering, the filter is after the browser to be
 > matched.
  > > SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
 > This is to match by server environment (requests), who know what goes
 > where and who goes first.
  > > Header append Vary User-Agent env=!dont-vary
 >
 > What is this one? I don't understand what it means and why it should be
 > there.
The Vary header will take you down into the HTTProtocal stuf ...
After my previous post I noticed
<a style='text-decoration: underline;' href="http://httpd.apache.org/docs-2.0/mod/mod_deflate.html" target="_blank">http://httpd.apache.org/docs-2.0/mod/mod_deflate.html</a> just tells a bit about
those.

 > If all are for mod_deflate, how come they don't have a unified syntax
 > and a unified documentation?
They all can steer some processing, most of this steering in not specific to
mod_deflate.

 > Is there a single place where all possible filters and matching methods
 > are listed and documented? I tried to find it but couldn't, so a pointer
 > would be most excellent.
There won't be a single location for both mod_defalte and mod_ssi are
totally seperate outputfilters
[Browser]matching is not at all specific for outputfilters ...

 > Would the following filter work in stopping mod_deflate from gzipping
 > files with mime type 'application/zip'? (I don't have a windows system
 > with IE handy to test the server config; from the reports that I got,
 > it's the only one exhibiting the problem).
 >
 > SetOutputFilter DEFLATE
 > AddOutputFilterByType no-gzip application/zip
NO, no-gzip, alike gzip-only-text/html, is not a valid outputfilter name ,
it's an /special/ enviromental parameter ...
<a style='text-decoration: underline;' href="http://httpd.apache.org/docs-2.0/env.html#special" target="_blank">http://httpd.apache.org/docs-2.0/env.html#special</a>

   > >> AddOutputFilterByType DEFLATE text/html
   > >> AddOutputFilterByType DEFLATE text/plain
   > >> AddOutputFilterByType DEFLATE text/css
  > > You could combine the three AddOutputFilterByType to a single line by
  > > listing multiple mime-type.
Why even bother to compress relative small files -like css and js-, that
[should] have a future expiration to? Why bother to compress images -unless
you're fond of bmp? Why not just stick to compressing text/html, text/plain
and forget about those ugly incapable browsers.

 > Thanks, done.
YW

HansH
--
Don't kill the messenger for the bad news he brought to you.<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: mod_deflate config question 
Back to top
Login to vote
jbrady1

External


Since: Mar 04, 2004
Posts: 5



(Msg. 5) Posted: Wed Sep 29, 2004 3:52 pm
Post subject: Re: mod_deflate config question [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Tue, 28 Sep 2004 18:13:12 -0400, HansH wrote
(in article <cjcnlp$393$1@news.cistron.nl>):

[huge snip]

 > Why even bother to compress relative small files -like css and js-,
 > that [should] have a future expiration to? Why bother to compress
 > images -unless you're fond of bmp? Why not just stick to compressing
 > text/html, text/plain and forget about those ugly incapable browsers.

Thank you for your assistance.

Unfortunately, I've come to the conclusion that apache 2 is still a bad
idea to move to. Despite the time it's been available and in
development, it's still way too immature for actual use.

I've removed the general deflate filter and set it to deflate only
text/html and text/plain and it's still exhibiting the same problem.

Plus it's not as efficient as the old apache 1.3/mod_gzip combination,
the bandwidth requirement is double what is was for the same content
even with a deflation setting of 9. For a site that delivers on average
4 million pages per day, doubling the bandwidth is very costly.

And on a really fast machine (compared to the old one -- New is dual
Xeon 3.0 Ghz with a fast RAID and the old is a single Pentium III 866
Mhz with a single IDE Drive) the site hesitates and pauses a lot, even
when accessing pages through the LAN; simply inexplicable.

I've decided to go back to 1.3 and wait few years until apache 2 becomes
useable.

--
J Brady<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: mod_deflate config question 
Back to top
Login to vote
hans1

External


Since: Mar 29, 2004
Posts: 672



(Msg. 6) Posted: Thu Sep 30, 2004 1:30 am
Post subject: Re: mod_deflate config question [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Jonathan Brady" <jbrady.DeleteThis@removethisspamkiller.myfmail.com> schreef in
bericht news:cjep7f0e1i@news1.newsguy.com...
 > On Tue, 28 Sep 2004 18:13:12 -0400, HansH wrote
 > (in article <cjcnlp$393$1@news.cistron.nl>):
 > I've removed the general deflate filter and set it to deflate only
 > text/html and text/plain and it's still exhibiting the same problem.
That is, sending double zipped zips via php???

 > Plus it's not as efficient as the old apache 1.3/mod_gzip combination,
 > the bandwidth requirement is double what is was for the same content
 > even with a deflation setting of 9. For a site that delivers on average
 > 4 million pages per day, doubling the bandwidth is very costly.
I hope this does not bother you too much
<a style='text-decoration: underline;' href="http://support.microsoft.com/default.aspx?scid=kb;en-us;Q312496" target="_blank">http://support.microsoft.com/default.aspx?scid=kb;en-us;Q312496</a>

 > And on a really fast machine (compared to the old one -- New is dual
 > Xeon 3.0 Ghz with a fast RAID and the old is a single Pentium III 866
 > Mhz with a single IDE Drive) the site hesitates and pauses a lot, even
 > when accessing pages through the LAN; simply inexplicable.
Did you check the server log -not the logs of virtuals- for "server reached
MaxClients setting"

 > I've decided to go back to 1.3 and wait few years until apache 2 becomes
 > useable.
Both are free as is the choice.

If about all your pages are php parsed, have a peek at
<a style='text-decoration: underline;' href="http://nl.php.net/ob_start" target="_blank">http://nl.php.net/ob_start</a>
" In PHP 4.0.4, ob_gzhandler() was introduced to facilitate sending
gz-encoded data to web browsers that support compressed web pages.
ob_gzhandler() determines what type of content encoding the browser will
accept and will return its output accordingly. "

Brings a new opener too, it _*/might/*_ even be PHP _causing_ the double
compression ...

HansH<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: mod_deflate config question 
Back to top
Login to vote
jbrady1

External


Since: Mar 04, 2004
Posts: 5



(Msg. 7) Posted: Thu Sep 30, 2004 1:30 am
Post subject: Re: mod_deflate config question [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Wed, 29 Sep 2004 16:30:51 -0400, HansH wrote
(in article <cjf61t$vd0$1@news.cistron.nl>):

 > "Jonathan Brady" <jbrady.RemoveThis@removethisspamkiller.myfmail.com> schreef in
 > bericht news:cjep7f0e1i@news1.newsguy.com...
  >> On Tue, 28 Sep 2004 18:13:12 -0400, HansH wrote
  >> (in article <cjcnlp$393$1@news.cistron.nl>):
  >> I've removed the general deflate filter and set it to deflate only
  >> text/html and text/plain and it's still exhibiting the same problem.
 >
 > That is, sending double zipped zips via php???

Yes, that problem is still manifesting itself. If the readers unzip the
downloaded file and unzip it, instead of getting a folder like they
should, they get another file with no extension. If they add .zip to its
name and unzip again, then they do get a folder with useable files in
it.

  >> Plus it's not as efficient as the old apache 1.3/mod_gzip combination,
  >> the bandwidth requirement is double what is was for the same content
  >> even with a deflation setting of 9. For a site that delivers on average
  >> 4 million pages per day, doubling the bandwidth is very costly.
 > I hope this does not bother you too much
<font color=purple> > <a style='text-decoration: underline;' href="http://support.microsoft.com/default.aspx?scid=kb;en-us;Q312496</font" target="_blank">http://support.microsoft.com/default.aspx?scid=kb;en-us;Q312496</font</a>>

That is very interesting because not everybody is reporting the problem
and all those who are are IE users. I think we're on to something here,
although, the nature of the site's audience makes it impossible to
recommend that article to the readers themselves (they're mostly older
generation -- over 55).

Microsoft's recommendation of disabling compression is not an option.
The kicker, however, is that it didn't happen with apache 1.3/mod_gzip
combination.

  >> And on a really fast machine (compared to the old one -- New is dual
  >> Xeon 3.0 Ghz with a fast RAID and the old is a single Pentium III 866
  >> Mhz with a single IDE Drive) the site hesitates and pauses a lot, even
  >> when accessing pages through the LAN; simply inexplicable.
 >
 > Did you check the server log -not the logs of virtuals- for "server reached
 > MaxClients setting"

It's nowhere near maximum users. So far I've narrowed down the glitches
in server response with header requests. When getting the status of css
and images to see if they've been modified, there is an inexplicable
delay, often few seconds. If the files are not in the browser's cache,
then they're delivered by the server promptly.

  >> I've decided to go back to 1.3 and wait few years until apache 2 becomes
  >> useable.
 > Both are free as is the choice.
 >
 > If about all your pages are php parsed, have a peek at
<font color=purple> > <a style='text-decoration: underline;' href="http://nl.php.net/ob_start</font" target="_blank">http://nl.php.net/ob_start</font</a>>
 > " In PHP 4.0.4, ob_gzhandler() was introduced to facilitate sending
 > gz-encoded data to web browsers that support compressed web pages.
 > ob_gzhandler() determines what type of content encoding the browser will
 > accept and will return its output accordingly. "
 >
 > Brings a new opener too, it _*/might/*_ even be PHP _causing_ the double
 > compression ...

Nothing was changed in the pages before moving them to the new setup, so
if it's the php code, then its interaction with the new software which
is apache 2.0.51 that is triggering the problem.

The exactly same code running on apache 1.3.31 and php 5.0.2 runs
flawlessly.

--
J Brady<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: mod_deflate config question 
Back to top
Login to vote
Display posts from previous:   
   Web Hosting and Web Master Forums (Home) -> Apache All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]