4 ms·
Hacking Head Tags for Speed and Profit
- voltagex_ 11y ago>If you're specifying X-UA-Compatible and the value is just "IE=edge", that's unnecessary. Remove it. Unless your IT department has deployed IE7 emulation mode via GPO for SharePoint. Then you need it to make sure your page doesn't explode
- nateberkopec 11y agoWhen I was writing about this, I didn't think the intranet case was so common. I may have underestimated that. EDIT: Updated the article to mention intranets.
- flipp3r 11y ago>If you're specifying X-UA-Compatible and the value is just "IE=edge", that's unnecessary. Remove it. No.
- nateberkopec 11y agoMan, this bit has gotten me flak everywhere. Here's what I think. 99.5% of websites that use this tag - it does nothing. Internet Explorer users don't set their own Compatibility View settings, so we can ignore that. Second, if you're cool enough to be on Microsoft's Compatibility View list, you're cool enough to know that you need an X-UA-Compatible tag and you know what it should be set to. The problem I have is people blindly copy-pasting this value from whatever HTML5 boilerplate they got it from. I'm going to rephrase this section of the post to make my point more clear. EDIT: Toned down my phrasing in the article to be more specific about when you can safely remove X-UA-Compatible tags. Yes, there's an argument that it doesn't cost you anything to keep it in there, but there's also arguments for ultra-short head tags (<4 KB) related to TCP windows, which I'll get into in another post.
- flipp3r 11y agoBeen a while since i browsed HN, anyway. It's good that you updated it, because I've had SO MANY issues with this with clients in the Dutch oil & gas industry, users working on IE and having their mode set to IE 7 to work with some rediculously ancient application. Adding the tag can save you a lot of time.
- flashman 11y ago> Concatenate all of your site's stylesheets and scripts into one file each. You can use something like Google Tag Manager to bundle scripts together. It is not suitable for every case, however, such as tags that need to be loaded synchronously (I believe).
- franze 11y agoi hate, hate, hate, hate google tag manager show me a google analytics setup with seriously screwed numbers, and i show you a site which loads GA via google tag manager.. people tend to think that they can bundle all the third party crap into their webpages with google tag manager and that there would not be any costs (to the project, to the user). this is wrong, google tag manager adds a whole new level of abstractions and issues. my tip: reduce third party crap that you don't need. implement them async into your code. regularly remove crap that you don't use.
- nateberkopec 11y agoThat's too bad. I really like the concept of Google Tag Manager. Are there are any "tag bundlers" that work? It seems like such a great idea.
- petecooper 11y agoInteresting reading, but this threw me a little: >meta tag This is probably the most common option. [...] If you do this, it's important that it's the very first element in the head. ...and a bit later on: >If you're going to specify a viewport size, do it at the very top of the head. @nateberkopec and other people much smarter than I: which is it? Edit x2: clarity.
- nateberkopec 11y agoCharacter encoding, then viewport tag. Really, the viewport tag just needs to be before any CSS - external or inlined.
- petecooper 11y agoGot it - thank you for clarifying.
- moron4hire 11y ago>> TCP isn't really designed for short bursts. Isn't that what connection keep-alive is for?
- nateberkopec 11y agoAbsolutely, that helps. But that doesn't help you if your page needs to make requests across 20 different domains.
- moron4hire 11y agoOh, yeah. This is why I don't use CDNs.