httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bo Berglund <>
Subject [users@httpd] Re: How to configure Apache 2 to compress xml files on serving?
Date Fri, 13 Jun 2008 18:06:01 GMT
On Fri, 13 Jun 2008 10:45:04 -0700, Dragon <>

>Perhaps the AddEncoding directive would help? I 
>don't really know as I have not tried it, but it is worth a try.
>Combined with the AddType directive to tell the 
>system that it is an xml file, it may well do what is needed.
>So something like this (I think):
>AddEncoding x-gzip .gz
>AddType application/xml .xml.gz
>Or maybe the type needs to be text/xml, both are 
>valid MIME types for xml documents but I don't 
>know which is appropriate to what circumstance.

OK, exactly where in httpd.conf do I add these directives?

Assuming my directory config I changed my directory section like this:

<Directory "C:/Engineering/Projects/XMLTV/XMLTVTestsite">
    Options Indexes MultiViews Includes
    AllowOverride None
    Order allow,deny
    Allow from all
    AddEncoding x-gzip .gz            <== New
    AddType application/xml .xml.gz   <== New
    AddType text/html .shtml
    AddType application/x-httpd-php .php
    AddOutputFilter INCLUDES .shtml 

and then restarted Apache, but the result is still that FireFox tries
to save the link to file instead of displaying the decompressed

Also tried with this instead but with the same result:
   AddType text/xml .xml.gz

Bo Berglund

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message