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

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

 





Bo Berglund wrote:
[...]

It seems like there is a setting in the Apache server to change so
that the server along with the actual file data also sends "something"
that triggers the expansion. What this could be I don't know, and
therefore I am asking here.

If I understand correctly, the files are already compressed on the original server (the file on disk is abc.xml.gz, as opposed to abc.xml), right ?

Then it probably has something to do with the HTTP headers sent in the response. Apache sends the response to the browser, with a HTTP header like
Content-type: application/gzip
or something similar, so that the browser believes that the .gz file is the original content, and proposes to the user to download it as such and save it to disk.

Instead, what you want is that the browser would "believe" that the gzipped file is only a way to transport the original content more efficiently, and that the real content is the xml file, unzipped.
So you want the response to be sent with HTTP headers like
Content-type: text/xml
Content-transport-encoding: gzipped

so that the browser would unpack the zipped file and present the XML document.

I am not quite sure of the exactness of the header names or form above, but it's the idea. I am unfortunately also not quite sure how to configure Apache to set the headers that way. It probably requires some module in-between. I'm sure a neat little mod_perl module would do fine here, but that may not be what you're looking for, and there might be a simpler way using Apache directives only.

Hope this helps anyway,
André


---------------------------------------------------------------------
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