Re: How to configure Apache 2 to compress xml files on serving?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 14 Jun 2008 13:59:38 +0200, André Warnier <aw@xxxxxxxxxx>
wrote:

>
>Add the following directive to the above section :
>  AddEncoding x-gzip .gz
>
>and try again
>
>> 
...
>> 
>> Probably now FireFox does not realize that the data are gzipped
>> anymore and tries to parse the binary compressed stream, which
>> obviously fails...
>
>Yes.  Because the server tells Firefox that the document is "text/xml" 
>and Firefox believes it.  That is the right thing to do for Firefox, 
>according to the corresponding Internet RFC's.
>(Unfortunately, that's not what IE does, but that is a whole separate 
>story, in which I hope we don't have to get).
>
>> Have to re-enable this directive...
>
>No.  Leave this one commented out :
> > AddType application/x-gzip .gz .tgz
>
>But add what I indicated above to your Directory section :
>  AddEncoding x-gzip .gz
>
>Note : I am also "fishing" to find the right settings.
>But you have to do this systematically, without getting lost about what 
>you add/remove, otherwise we will not know anymore.
>The important part is what the server sends as headers with the HTTP 
>response.
>We must get to a situation where it sends :
>Content-Type: text/xml  (or application/xml ?)
>Content-Encoding: gzip  (or x-gzip ?)
>
>So that Firefox knows that is is XML, but that it is gzipped.
>
>---------------------------------------------------------------------
>The official User-To-User support forum of the Apache HTTP Server Project.
>See <URL:http://httpd.apache.org/userslist.html> for more info.
>To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
>   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
>For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx
>

I think we/you got it now! :-)

I did this in the httpd.conf:

Commented out this in the genaral sections
# AddType application/x-gzip .gz .tgz

Made the directory look like this:

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



And now the headers become this when I access a xml.gz link:

HTTP/1.x 200 OK
Date: Sat, 14 Jun 2008 16:55:40 GMT
Server: Apache/2.0.54 (Win32) PHP/4.4.7
Last-Modified: Thu, 12 Jun 2008 22:18:16 GMT
Etag: "5ac36-159b-89b5a184"
Accept-Ranges: bytes
Content-Length: 5531
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Content-Type: text/xml
Content-Encoding: gzip

And FireFox displaye the *contents* of the gz file rather than offer
to save it!
BINGO!

A *really* great THANK YOU! for helpong me out!

Bo Berglund


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux