Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
Thank You! Steffen
Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
| |
|
Topic: mod_deflate woes |
|
Author |
|
drdave
Joined: 10 Aug 2009 Posts: 1 Location: Pennsylvania
|
Posted: Mon 10 Aug '09 23:45 Post subject: mod_deflate woes |
|
|
I have two Apache servers: a development server on WinXP (just upgraded today to 2.2.13) and a production server on Linux (2.2.10).
I dynamically create large sets of essentially table data through web service calls and the load time is excessive. Therefore I want to use compression. I have activated mod_deflate on both systems and used the same configuration for both:
Code: | # Only compress specified content type
<Location />
<IfModule mod_deflate.c>
# compress content with type html, text, javascript and css
AddOutputFilterByType DEFLATE text/html text/plain text/css text/javascript
<IfModule mod_headers.c>
# properly handle requests coming from behind proxies
Header append Vary User-Agent
</IfModule>
</IfModule>
</Location>
# deflate.log, log compression ratio on each request
<IfModule mod_deflate.c>
DeflateFilterNote Input instream
DeflateFilterNote Output outstream
DeflateFilterNote Ratio ratio
LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%)' deflate
CustomLog logs/deflate.log deflate
</IfModule>
# Properly handle old browsers that do not support compression
<IfModule mod_deflate.c>
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
</IfModule>
|
Now it gets interesting:
WOE NUMBER 1:
According to Firebug, I am getting gzip compression on HTML files on the Linux server, but not on the Windows server. (The Windows server is running Apache as a service available to all users. In a different forum, I found a post with a similar issue, but no response.)
WOE NUMBER 2:
Both systems created a deflate.log in the logs directory, but both are totally empty. I am almost certain that at least some files are being compressed in the Linux environment, but I get no information in the log.
WOE NUMBER 3:
For JavaScript, I am totally befuddled. I have a .js file that is included with..
Code: | <script type="text/javascript" src="....."></script> |
On Linux, the Response Header reported by Firebug:
Server: Apache/2.2.10 (SentOS)
Content-Type: application/x-javascript (<== ? different than the <script tag!!)
Needless to say, it is not "text/javascript" and is therefore not compressed.
On WinXP, the Response Header reported by Firebug:
Server: Apache-Coyote/1.1 (<==WHAT? This is Apache/2.2.13!)
Content-Type: text/javascript
SO:
A: No compression from WinXP installation
B: Nothing in the log file
C: Weird things with .js files
Any suggestions will be greatly appreciated!!
ddsp |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Thu 13 Aug '09 20:11 Post subject: |
|
|
My working config under Windows 2003
Code: |
SetOutputFilter DEFLATE
DeflateCompressionLevel 9
DeflateFilterNote Input instream
DeflateFilterNote Output outstream
DeflateFilterNote Ratio ratio
LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%)' deflate
CustomLog /server2/logs/deflate.log deflate
|
|
|
Back to top |
|
|
|
|
|
|