Solved

Defalte module

Posted on 2008-10-23
7
190 Views
Last Modified: 2008-12-15
I dont want xml files to gzipped and i have to block it using the content type i have used the following configuration.
LoadModule deflate_module /opt/www/eaws/apache/modules/mod_deflate.so

<Location />

AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE text/html

BrowserMatch \bMSIE\s6 no-gzip

SetOutputFilter DEFLATE
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
SetEnvIfNoCase Request_URI \.pdf$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.avi$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.mov$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.mp3$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.mp4$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.rm$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.swf$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.flv$ no-gzip dont-vary

</Location>
 
0
Comment
Question by:kranthi_50404
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
7 Comments
 

Author Comment

by:kranthi_50404
ID: 22791646
sorry my wording may get you confused..

My requirement is not to compress the xml files and i have used above mentioned code. I want to know whether there is any way we cannot compress a file using the content type rather than extensions for deflate filter.
0
 
LVL 57

Expert Comment

by:giltjr
ID: 22795160
First, why in the world would you NOT want to compress xml documents.  They are the perfect choice for for compression.  

Anyway, you can do this by type, but you need to do it backwards.  That is you compress nothing by default and then use AddOoutputFilterByType for what you want to compress.  Here is an example:

http://forums.devshed.com/apache-development-15/gzip-deflate-based-on-content-type-browser-446938.html
0
 

Author Comment

by:kranthi_50404
ID: 22797240
I have implmented the above mentioned code and i was not able to get the result ... but i have removed teh SetOutputFilter DEFLATE and the result was fine. just intersted in knowing the reason
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 57

Expert Comment

by:giltjr
ID: 22797415
Setting SetOutputFilter DEFLATE will cause all output to be deflated by default.  When you remove it, then no output will be deflated, unless you specifically tell Apache to do it.

Can I ask why you don't want to compress XML?
0
 

Author Comment

by:kranthi_50404
ID: 22799281
we had a problem with the flash player which makes use of the xml files .... it breaks since the xml file is been be zipped...
0
 
LVL 57

Expert Comment

by:giltjr
ID: 22799519
Ah, O.K.  I did a quick search and found this:

http://mentalized.net/journal/2007/07/31/warning_gzip_content_flash_player_and_internet_explorer_6/

Which I am assuming is still a problem.  Apparently IE does not un-compress data prior to passing it to Flash (I would assume any plug-in for that matter).  I would further assume that Flash can't handle compressed data.
0
 
LVL 27

Accepted Solution

by:
caterham_www earned 500 total points
ID: 22800423
And

AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE text/html

only does not fit your requirement? That should set the filter DEFLATE to the specified types only. A xml file should have text/xml or application/xml or something other but not text/html or text/plain, so output filtering should not occur.
0

Featured Post

Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my time as an SEO for the last 2 years and in the questions I have assisted with on here I have always seen the need to redirect from non-www urls to their www versions. For instance redirecting http://domain.com (http://domain.com) to http…
Over the last year I have answered a couple of basic URL rewriting questions several times so I thought I might as well have a stab at: explaining the basics, providing a few useful links and consolidating some of the most common queries into a sing…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question