One of the not-so-joyous moments of being a web developer is the fact that we still need to support browsers that are ancient (by technological standards). Specifically, I'm talking about Internet Explorer 6.0. A quick look at the site statistics of one of the major websites I'm currently working on says that 16.9% of users visited our site using Internet Explorer 6.0. That's obviously not the majority - Internet Explorer 7.0 takes that honor with 38.4%, followed by Firefox 3.0 with 19.8%. But it's still a large enough number for the higher-ups to decide not to ignore it.
Since I never, ever use Internet Explorer 6.0 for any regular browsing (and you shouldn't, either - read why on sites like Browse Happy), this past week I decided to give the site a test run with Internet Explorer 6.0 (using IEs 4 Linux). Besides the frustration of finding some incompatibilities with standard CSS on this browser, everything else seemed to work well. I then triggered an error on purpose, just to make sure our error handling would be handled properly (display our custom 404 error page instead of a nasty -yet customized - 500 error page). To my surprise, Internet Explorer 6.0 decided to render its own friendly error page instead of our custom one.
Thinking one of my colleagues removed it for whatever reason, I fired up Firefox and triggered the same error. The custom 404 page appeared correctly. Heading over to a Windows laptop, I had the custom error page on all browsers, including Internet Explorer 7.0. This left me scratching my head for a while. Although I'm already used to Internet Explorer 6.0 to act in different ways, standards be damned, this act seemed to be stupefying.
I was about to give up, thinking that Internet Explorer 6.0 used to hijack everyone's custom error page just to hawk their own, I did a search on 404 error pages. Lo and behold, Wikipedia came through with a response that I would have never guessed:
Internet Explorer (before Internet Explorer 7), however, will not display custom pages unless they are larger than 512 bytes, opting to instead display a "friendly" error page.
Wow. Who knew that size mattered? On a custom error page, of course.
Our custom 404 was basically just a regular HTML with the standard tags, and one image and it weighed less than 300 bytes. I couldn't modify the design or anything, so I just padded the error page with a long, boring and senseless comment, explaining why said comment was there. After 'fattening up' the file to more than 512 bytes, the error page started appearing on Internet Explorer 6.0.
It turns out that older versions of Internet Explorer had a threshold value in the registry which decided whether to display their own error page or a custom one. Why? I have no idea. Thankfully that was fixed for recent versions. But for all of the unlucky ones who still have to support ancient technology, this is another special Internet Explorer 6.0 quirk that needs to be taken into consideration.
For more information, including the default size limitations for other error pages, read this site (aptly named '404-error-pages.com') has all the information you need.