Link to home
Start Free TrialLog in
Avatar of kranthi_50404
kranthi_50404Flag for India

asked on

Defalte module

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>
 
Avatar of kranthi_50404
kranthi_50404
Flag of India image

ASKER

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.
Avatar of giltjr
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
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
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?
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...
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.
ASKER CERTIFIED SOLUTION
Avatar of caterham_www
caterham_www
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial