How to turn off gzippping files by Apache?


#1

Something very weird is happening to my website (www.tranglos.com, on server annie). This is what the site looks like in IE 5.5: http://www.tranglos.com/garbageie.gif and in Netscape 4.7: http://www.tranglos.com/garbagens.gif

The garbage characters are displayed because the browser receives the file (index.html and any other html files) gzip-compressed. Opera and Mozilla can apparently handle it (display is fine), but IE and Netscape don’t. The problem only affects HTML files, not images.

Now for the weirdest thing: when I use a download manager (I’ve tried several) to get any html file off my website, the downloaded file is gzipped, though the extension is still .html. So this is not a browser problem, nor is it caused by anything on my local machine. (The files on my home system are, of course, not gzipped!) When transferred by FTP, the files do not arrive gzipped.

The gzipping is clearly performed by the Apache web server, but MSIE simply cannot handle it, which renders the pages unviewable. I need to disable it, but I can’t see how. Here’s a snippet of the request-response from Dreamhost’s web server:

  • request:
    GET /free/index.html HTTP/1.1
    Connection: close
    Host: www.tranglos.com
    Accept: /
    Pragma: no-cache
    Cache-Control: no-cache
    Referer: http://www.tranglos.com/free/
  • response:
    HTTP/1.1 200 OK
    Date: Sat, 05 Apr 2003 21:21:30 GMT
    Server: Apache/1.3.27 (Unix) mod_gzip/1.3.26.1a mod_ssl/2.8.10 OpenSSL/0.9.6c PHP/4.2.3 DAV/1.0.3
    Last-Modified: Mon, 10 Mar 2003 00:06:36 GMT
    ETag: "72c32b-626-3e6bd70c"
    Accept-Ranges: bytes
    Content-Type: text/html
    Content-Encoding: gzip
    Content-Length: 810
    Data transfer started
    (end)

Marek Jedlinski


#2

Support can disable it for you if you write in and request it. mod_gzip is enabled by default, and should work with pretty much all modern browsers (and, IIRC, should revert to non-gzipped pages otherwise) – but it’s no problem to disable it for one or more domains.

Do make sure to let us know the exact domains and / or subdomains you want this done for if you have multiple domains. Also, if you add new domains, you’ll need to write in about them once you’ve added them.

It probably wouldn’t be hard to add this as a user-configurable option. Note that your bandwidth usage may go up when not using mod_gzip.


#3

Thanks a lot, Will, for the reply. I have meanwhile traced the problem to Proxomitron - Prox was set up to ignore (bypass) requests to www.tranglos.com, but evidently it was still messing up with them. (Now I’ll need a better proxy :wink: What I don’t quite understand is that the problem was only occurring when a frameset html file was being loaded, but opening a non-framed file was OK. In Netscape, without Proxomitron, garbage is still displayed the first time, and the page is then displayed correctly when I reload.

Thanks a lot for the explanation, and please leave the gzip option enabled; I do appreciate the bandwidth it saves.


“Well I can get the ‘a’. But how do I put the circle around it?”