You are here:Home arrow Home arrow PHP arrow Super slow website on IE6?
  • Narrow screen resolution
  • Wide screen resolution
  • Decrease font size
  • Default font size
  • Increase font size
  • default color
  • green color
  • blue color

Super slow website on IE6?

Friday, 21 August 2009

Here is a quick advice on fixing performance related IE bug on your websites. I've discovered this problem while working on a client's website.

The Problem: Site is being slow at all times only in Internet Explorer 6, not matter whether it is latest version (SP3) or older.

Cause: I tried debugging this problem with a traffic inspector and suprisingly I found that IE 6 makes a huge number of requests to "/none" URL. Saving generated page locally and searching for occurences of "/none" links yilded no results. It comes out the IE 6 treats common css rule like "background: none" on elements as "background: url (none)" thus requesting non-existant file from server slowing down everything. That makes me think of another IE 6 bug: if "/none" returns 404 (not found) IE 6 still requests it for other page components. So your site may be slower or extremely slower depending on the number of components (HTML elements) which use similar CSS rule.

Solution:Instead of fixing the CSS code which isn't made by me anyway (I'm more of a backend developer than designer, but I think background: none is perfectly valid shorthand CSS declaration) I decided to fix the IE itself. Below are the steps for fixing it.

  • Create an empty "none.php" file in your website root directory
  • Place the following contents inside: <?php
    header('Expires: Sat, 22 Aug 2999 12:33:04 GMT', true);
    ?>
  • Change your .htaccess to include the following rules (on top of the file below enabling rewrite engine): RewriteRule ^none$ none.php
    RewriteRule ^(.*)/none$ none.php

Now for every request to "/none" (that only IE 6 makes), it will get a quick empty 200 (OK) response with "Expires" header set long time in future. That is, it is unlikely that the client's browser will request the resource more than once. Note that rewrite rules account for "requests" on each directory level because the "none" bug occurs relative to the URL accessed (if you access /your/page/ IE 6 would request /your/page/none)

This effectively fixed the slowness of IE 6 opening pages for me, please comment if it worked for you :)





Reddit!Del.icio.us!Facebook!Slashdot!Netscape!Technorati!StumbleUpon!
Last Updated ( Friday, 21 August 2009 )

Add comment


Security code
Refresh

< Prev   Next >