1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Lack of Interest Remove the X-UA-Compatible meta tag and use a server header, or htaccess instead

Discussion in 'Closed Suggestions' started by Rob, Aug 13, 2015.

  1. Rob

    Rob Well-Known Member

    Ok, this isnt the biggest optimisation in the world but it avoids serving that IE only compatability tag to all users.

    It can be dropped from the styles, and instead a simple bit of PHP can sent it as a server header:-

    if (isset($_SERVER['HTTP_USER_AGENT']) &&
    strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false))
    header('X-UA-Compatible: IE=edge,chrome=1');
    Or you could add it to the .htaccess file:-
    <FilesMatch "\.(htm|html|php)$">
       <IfModule mod_headers.c>
            BrowserMatch MSIE ie
           Header set X-UA-Compatible "IE=Edge,chrome=1" env=ie
    This will save some bytes for anyone not using IE, but also bring us a step closer to w3c validation.
    Axel B and Mouth like this.

Share This Page