Skip to main content

Posts

Showing posts from March, 2014

You may not need meta charset

It is generally accepted that web pages should have a meta tag to set the charset of the document. However, you may not need it. The HTML5 specification clearly states that when  determining the character encoding  that if it is found in a content-type header attribute, then the engine should no longer look for one in the document or anywhere else. You can set the header either in your application logic or in your server configuration ( Apache  and Nginx examples). So what does this mean for developers?  Well, we all know performance matters. Let's say after gzipping your content this declaration adds just an extra three bytes of data to your page. Across millions of requests around the web per hour which leads to billions per year, that ends up saving a lot of space. Not only that, but think about how the network functions. Packets on the internet have a set amount of space. This is called the  maximum transmission unit  size. It is generally at 1500 bytes per packet for e