internet-exploreriisx-ua-compatible

IIS Compatability Mode setting for IE


I am not sure whether this question has been asked previously or not, but here it is. We know we can set Compatibility mode setting for our site in IIS through HTTP response header like this

 X-UA-Compatible    IE=<Version>

I have following questions for this:

  1. Which compatibility mode take preference, the one configured with IIS or the other inside Master Page?

  2. Can we put multiple Compatibility setting through IIS? If yes how? Comma separated like this ?

    X-UA-Compatible    IE=<Version1,Version2>
    

    or mutiple headers like this

    X-UA-Compatible    IE=<Version1>
    X-UA-Compatible    IE=<Version2>
    

    or in both ways?

  3. If multiple compatible settings are possible through IIS, which setting will have the precedence? for e.g, If I want my site to run in IE7 mode for IE10 and IE11 and IE8 mode for IE8 and IE9, will that be possible with point no. 2??

Solution

  • In order:

    1. Per the documentation, the one in the HTML page overrides one delivered by the web server.
    2. Another piece of documentation shows how to specify multiple document mode values:

      <meta http-equiv="X-UA-Compatible" content="IE=7,9,10" >
      
    3. Per the previous documentation citation, the highest supported mode specified by the content value wins. With the earlier example:

      • IE7 and IE8 uses IE7 standards mode
      • IE9 uses IE9 standards mode
      • IE10 and IE11 for the desktop use IE10 standards mode
      • IE11 in the Windows Store experience uses IE11 standards mode (because it doesn't support document modes).
      • MS Edge uses MS Edge mode (because it doesn't support document modes. To answer your final question: No. Document modes are designed to favor later versions over earlier versions. (The thinking is that each version of standards mode improves on the other.)

    The docs do provide flowcharts to illustrate this, though these do not appear to be consistent:

    This complexity is a major reason why document modes are no longer supported.

    Also, be aware that how you deliver the results also has an impact. If the site is delivered in Intranet zone, you may wish to consider using a Mark of the Web to deploy the site in the Internet zone in order to simplify the documentation mode evaluation process.

    Hope this helps...

    -- Lance