Solved

Defalte module

Posted on 2008-10-23
7
187 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
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

 
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

Suggested Solutions

Title # Comments Views Activity
How to create web api to extract oracle data using php 4 70
slow web access in oversea location 3 67
browser caching 4 71
.htaccess file settings 4 58
If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

770 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