Solved

Defalte module

Posted on 2008-10-23
7
189 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
  • 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
Connect further...control easier

With the ATEN CE624, you can now enjoy a high-quality visual experience powered by HDBaseT technology and the convenience of a single Cat6 cable to transmit uncompressed video with zero latency and multi-streaming for dual-view applications where remote access is required.

 
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

As Wikipedia explains 'robots.txt' as -- the robot exclusion standard, also known as the Robots Exclusion Protocol or robots.txt protocol, is a convention to prevent cooperating web spiders and other web robots from accessing all or part of a websit…
In Solr 4.0 it is possible to atomically (or partially) update individual fields in a document. This article will show the operations possible for atomic updating as well as setting up your Solr instance to be able to perform the actions. One major …
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

820 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