Solved

Defalte module

Posted on 2008-10-23
7
184 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
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…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

707 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now