Saturday, 26 March 2005

Finally, gzip-encoding works

I've been trying to fix gzip-transfer-encoding on moria.org.uk. mod_negotiation was refusing to offer a .gz as an alternative to an uncompressed file. After trying a lot of different arrangements, I spotted that even when it served a .gz, it did not return the underlying content's MIME type; it seemed to be ignoring the AddEncoding for .gz. Finally, I stopped messing around and read the source code. It seems that apache simply looks up each component of a filename against its list of extensions, and that it checks MIME types before it checks encodings. Remove .gz from /etc/mime.types and everything starts working. Always read the source!

0 comments:

Post a Comment