We have already seen many great tips for speeding up a website. These tips are great, but I want to share with you five more tips that are less common. Generally these tricks can’t be used in every situation (just like any other trick), but they are useful to speed up your website even more and offer better experience to your visitors.
1. Use ASCII encoding over UTF-8
Using ASCII charset over UTF-8 will positively affect speed of the web page. Web page will speed up because ASCII is the smallest charset that we can use. Because browsers display HTML and XML only, every character will be translated to it’s HTML code. Translation process will be fastest if you use smallest charset (ASCII).
To use ASCII encoding, add this code to head section of page:
<meta charset=”us-ascii” />
Why I shouldn’t use ASCII encoding
If you have to use non ASCII characters (e.g. copyright sign) or you have to use language specific characters, you have to go with UTF-8 or some other charset that has characters you need.
2. Use internal CSS over External
Every time webpage is accessed, HTTP requests are made to get content of every external files needed for presentation of this page. Using internal CSS over external will help you speed up your web page by eliminating one or more requests for external CSS files.
Why I shouldn’t use internal CSS
If you decide to use internal CSS, you have to repeat same code on every page instead of just linking to one .css file. It will make harder for you to maintain your website, and if your website has many pages you will have to use much more space on hard drives because every page will get bigger due to CSS style being embeded into it.
4. Use file extension in URL
If you want to use extensionless url-s they will require you to set up .htaccess file (or any other equivalent) so that file extension will be added to url before accessing page. Url rewriting will unnecesarily take some time, which will result in slower web pages.
Many people thinks that extensionless url-s has additional SEO value over url-s with extension. This is not true. According to Matt Cutts, search engine bots like url-s with extension.
Why I shouldn’t use extensions in url
Url-s without extension looks cleaner and are also easier to remember by visitors. Using extensionless url-s will allow you to seamlesly switch from one technology to another in future (e.g html to php, php to asp). In that case you will only need to change extension to be added in .htaccess, instead of redirecting every old page to new one.
5. Avoid .htaccess usage
Any time you have to use .htaccess to rewrite url, you are slowing down your website. Although, url rewriting is very fast, it still takes some time especially if you have multiple rewrite rules in .htaccess file. Allowing access to a page directly would speed up your website a bit.
Why I should use .htaccess
If you can’t make SEO friendly url without rewriting url-s, then you should use .htaccess for rewriting. SEO benefit from SEO friendly url-s is much greater that disadvantage of having a bit slower website. Url rewriting is reccomended if you use url parameters.