IE9 Testing Trap

Just another little tidbit I’ve picked up while wrestling with some IE9 compatability issues, something that I thought it might be worthwhile to pass along - might save you some hair-pulling.

In playing with things like <meta http-equiv=“X-UA-Compatible” content=“IE=EmulateIE8”>, along with some other hacks, I’ve discovered that there are times when a “refresh” in IE9 doesn’t actually refresh the page. In these instances, clicking on the “refresh” icon, or hitting F5, or even hitting a CTRL-F5 won’t do the trick. You have to close the browser, open it again, and reload the page.

When does this happen? I wish I could pin it down more precisely, but when fiddling with the X-UA nonsense, I’ve encountered it repeatedly. I think I’ve seen it in other circumstances, but I can’t swear to it. If you view the page source, the new source code is there, but it isn’t reflected in the actual page display.

The short take-away lesson is that if you’ve edited your page, but IE9 doesn’t seem to be reflecting the change, even after a refresh, try re-launching the browser before you surrender!

Even better, try clicking in the URL bar (the address bar, location bar) to put the focus there, and hit ENTER. I bet it should do the trick! :wink:

Another tidbit, discovered after hours of hair-pulling, and some Googling. Another pair of lessons to be learned:

  1. If you’re going to use <meta http-equiv=“X-UA-Compatible” content=“IE=EmulateIE8”>, it must be the first tag in the <head> section. If it’s not, the results are unpredictable, to use a polite word for the flakiness I ran into (I mean, really, how can a page load differently before I’ve had a cup of tea than it does after?).

  2. While testing, not only do you need to close and reopen the browser, it is also frequently necessary to hit Tools, Internet Options, and delete all the history - I believe it’s just the temp internet files that have to go, but I’ve finally resorted to something closer to a “scorched earth” approach to it.

  1. Old news: http://blogs.msdn.com/b/ie/archive/2008/06/10/introducing-ie-emulateie7.aspx.

  2. Any tech proof suggesting this to be a general problem rather than a problem with your machine and OS and UA setup?

Appropriate solution:
Defining Document Compatibility

If your site does not display correctly in Internet Explorer, you can either update the site to support the latest web standards (preferred) or you can force Internet Explorer to display your content as if it were being viewed in an older version of the browser. This is done by using the meta element to add an X-UA-Compatible header to your webpages.

This allows you to choose when to update your site to support new features supported by Internet Explorer.

along with already known meta X-UA issue and suggested solution:

The X-UA-Compatible header is not case sensitive; however, it must appear in the header of the webpage (the HEAD section) before all other elements except for the title element and other meta elements.

I can narrow this down further. For most page changes, a browser refresh (CTRL-F5) does what you would expect, forcing a reload of the page. The one consistent exception is any change to the meta http-equiv X-UA-Compatible tag, particularly when you insert one on a page that didn’t previously have one. In that case, IE9 hangs onto the cached version of the page like grim death. Closing and reopening the browser won’t clear it. Deleting the temp files won’t clear it. You need to do both.

This is with the official, released version of IE9, unmodified, with default settings, and with no user-applied extensions or addons of any kind.

(And by the way, thank you for confirming what I posted about the criticality of the positioning of this particular meta tag.)

IE9 official release, yes, but on what OS? And what’s the status of that OS? Official release also? A clean machine and OS ?

If you can’t prove it, I guess we’ll have to wait for others to confirm it.

No problem about the positioning of the meta, except you’re the one confirming, the “bug” is well known before IE9 and before 2011.

OK, thread cleaned up.
Please keep it civil and tidy folks.

I believe there are other venues for this problem you have.

Using the Developer Toolbar (F12), go to the Cache menu and Clear browser cache for this domain… and Clear cookies for domain.

Also, Caching Improvements in Internet Explorer 9: http://blogs.msdn.com/b/ie/archive/2010/07/14/caching-improvements-in-internet-explorer-9.aspx.

Off Topic:

It seems that for to aspx pages, the title is not used as link text.

If you add the X-UA-Compatible tag to the code, it’s necessary to clear the cache (by whatever means - Tools, Internet Options or the Developer Toolbar), and then to close and reopen the browser before it takes effect.

If, on the other hand, you remove that tag, a simple refresh works as expected.

One other thought: do you have the Compatibility View button pressed on the address bar?

IE Compatibility List Pruning: http://blogs.msdn.com/b/ie/archive/2009/07/01/ie-compatibility-list-pruning.aspx.

CV is never invoked, the CV list is empty, and the option to use the MS CV list is off.