简体   繁体   中英

Where to set the X-UA-Compatible: IE=Edge?

I want to set X-UA-Compatible: IE=Edge for my webpage hosted in IIS. Where can i set this?

I know that it can be set using two ways

  1. Using IIS http header
  2. setting X-UA-Compatible in html meta tag .

Here my questions

  1. which method should i consider?
  2. In performance perspective which is good?
  3. Will it affect the performance if i set using both the ways. ( assume both are difference values)

I would recommend setting it in both the html meta tag as well as the response header. The response header will precede the meta tag but for local purposes, the meta tag will act as a fallback mechanism. Setting both will not affect the performance.

Setting through meta tag however causes your site to break W3C validation. So I personally prefer header. As I've shown here: http://www.salmanq.com/blog/ie-compatibility-and-w3c-validation/2013/03/

As per msdn, browsers (at least IE8) looks for the meta tag first before the HTTP headers.

http://blogs.msdn.com/b/ie/archive/2010/03/02/how-ie8-determines-document-mode.aspx

So no need of adding in two places. meta tag is enough.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM