: Character set not specified in HTTP headers error When testing this page with Page Speed, I get the a Specify a character set error: The following resources have no character set specified
When testing this page with Page Speed, I get the a Specify a character set error:
The following resources have no character set specified in their HTTP headers. Specifying a character set in HTTP headers can speed up browser rendering.
The Content-Type tag is present and the page was saved with UTF-8 encoding as well, so where is the error coming from?
More posts by @Lee4591628
1 Comments
Sorted by latest first Latest Oldest Best
It is referring to Response Headers and not document body ("Content-Type tag").
If you check Response Headers of your page with any HTTP Debugger (for example, Net panel of Firebug for Firefox, or similar tab of Developer Tools in Google Chrome/Internet Explorer/Safari/Opera), you will see this line:
Content-Type: text/html
At the same time, if you check the same for this page, you will see:
Content-Type: text/html; charset=utf-8
Page Speed is referring to the missing part. Having correct character set present in headers will indeed speed up rendering the page a bit. With incorrect charset specified in response header (or no character set at all) browser needs to scan/interpret the page until it find the correct character set declaration (the <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> line) and then re-start the rendering process if character set is different from browser's default setting.
The performance penalty is not big at all -- for user it is unnoticeable unless really old/slow hardware is in use (although it differs for each browser and browser version). Maybe there are some other "penalties" that are directly related to this, but I personally unaware of them.
Fixing: If you generate this header yourself (in your PHP script), then you need to alter it to include charset as well. If your script does not do such header manipulations, then it is server misconfiguration issue.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.