Content with Style

Web Technique

mod_deflate and IE6 bug

by Pascal Opitz on April 20 2007, 12:46

This one was very strange. IE 6.0.29 would randomly come up with white pages. On the local servers it would come up fine, and so it did in any other version of IE, nor when using the multiple IE installer.

Trying to use Charles to sincerely scrutinize the headers and output for dodgy characters made the problem just go away.

Turns out that the gzip compression added by mod_deflate just wasn't well digested. The following lines in the http.conf caused the misery.


AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/x-javascript
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4.0[678] no-gzip
BrowserMatch bMSIE  !no-gzip !gzip-only-text/html

Changing the last two lines would turn off the mod_deflate compression for IE6 but leave it in for IE7:


BrowserMatch ^Mozilla/4.[0678] no-gzip
BrowserMatch bMSIEs7  !no-gzip !gzip-only-text/html

For testing the HTTP headers that come through one can use the ieHTTPHeaders plugin for IE or Rex Swain's HTTP viewer.
Happy Debugging!

Comments

  • If you need to examine HTTP traffic on a Windows box, you can’t really do better than Fiddler, an HTTP debugging proxy written by Eric Lawrence of Microsoft. It’s free, and as well as allowing you to inspect HTTP traffic, it can be extended (via JScript.NET) with scripted rules and custom inspectors.

    It’s available at http://fiddlertool.com, if the link above doesn’t show up (it doesn’t appear on preview).

    by Nick Fitzsimons on April 22 2007, 11:54 #

  • “Internet Explorer May Lose the First 2,048 Bytes of Data That Are Sent Back from a Web Server That Uses HTTP Compression”
    support.microsoft.com

    or

    “BUG: Script Errors with Cache-Control:no-cache HTTP Header and HTTP Compression”
    support.microsoft.com

    just to name a few.

    by maurizio on January 16 2008, 07:44 #

  • May I suggest a tweak for the MSIE line, as Internet Explorer 8 isn’t far off and your current configuration doesn’t take it into account. The following line should enable compression for IE7 and 8.

    BrowserMatch bMSIEs(7|8) !no-gzip !gzip-only-text/html

    by gordon on July 24 2008, 04:45 #

  • Thank you! This REALLY helped me :) :)

    by Jase Clamp on July 9 2010, 14:13 #

  • Cheers for that ... one of the issues we had before we moved on to our new blog system ...

    by Pascal Opitz on March 27 2009, 14:23 #

  • Just to note before anybody else just copies it to the server without reading it through :) Those examples are missing couple BACKSLASHES, one before \'b\' and one before \'s\' letters. So the corrent line is: BrowserMatch \\bMSIE\\s(7|8) !no-gzip !gzip-only-text/html other than that, thanks for the hint. I had some wierd issues when ie6 didn\'t load javascripts correctly, until now.

    by holli on March 27 2009, 00:33 #

  • props for this updated line...

    looks like i have not been gziping anything but text/plain for ie* for the last year or so :/

    thanks!

    by tom3k on August 11 2009, 08:45 #