For yslow page speed I want to remove my meta tag and put my encoding in the htaccess. These are all the ways I have read to do it. Which is the preferred way? Also is the language setting a good idea too? Thanks!
All header-based forms have one drawback: If someone saves your page locally (yes, this might be done for legitimate reasons, not just by scrapers) the page will not contain any text encoding information of its own. So it may display incorrectly.
How much does a charset meta tag add to page loading time? Or, more exactly: does reading a header take less time than reading a meta tag?
Depending on content, your css and js may not even need to be utf-8 encoded. I've got a lurking suspicion that ascii reads faster-- but only if the browser knows ahead of time that it's ascii. (For comparison purposes, I've only got one stylesheet that contains non-ascii information. I expected to use an entity but it didn't work.*)
* Pseudo-class content. It displayed the literal entity instead of the intended non-ascii character. Oops.
Ya im going to keep my meta tag in my page too. For my testing purposes and as you said. Didnt think of that one. Apparently the browser is able to "look ahead" (IE8 term) and start parsing the page before it even reads it with the header info in place. Prob a 1/1000 time dif but oh well. I want that A page speed grade damnit! More reading has lead me to this code. I'm pretty certain this is all I need to serve all file extensions both rules...
AddDefaultCharset utf-8 in your .htaccess is the way to go if you want that 100% grade on something like yslow or google page speed. But, you also have to leave the meta version in place or your page will get an error warning of it missing when it's parsed with the W3C validator. So keeping both works -- that's what I use.