How to Boost the Performance of Your Website to Promote it in Search Engines – Fourth Part
Tuesday, October 13, 2009 11:19->
Minifying the size of JavaScript and CSS codes by removing unnecessary characters is a practice to improve the loading time of websites. Minifying codes means removing unwanted comments as well as white space characters. JSMin and YUI Compressor are two powerful and popular tools to reduce the volume of JavaScript and CSS codes.
An alternative approach to optimizing source codes is obfuscation. More complicated than minification, obfuscation is likely to produce bugs. Therefore, minifying JavaScript and CSS codes is safer than obfuscation, though the latter is useful for higher size reduction. It is possible to minify inlined scripts and style blocks other than external scripts and styles. Minifying scripts and styles reduces the size of files by 5% more than gzipping them.
Redirects no doubt slow down the loading of websites. A redirect between the HTML document and the user delays the loading time of webpage components. The delayed arrival of HTML documents means the slow rendering of pages and the slow loading of components. One of the worst redirects happens when a trailing slash is missing from a URL. Such mistakes result in a 301 or 302 response that turns up with a redirect.
In addition to redirects, users can be directed to a different URL by JavaScript codes. If a redirect is your need, the standard 3xx HTTP status codes should be a technique of your choice. Redirects are useful also when an old website is connected to a new one. Redirects are put into application to connect different parts f a website. If a domain name is changed, it makes the use of redirects necessary. However, it affects the user experience. Alternatives to redirects can be thought of.
Websites with the same JavaScript file two times in a single page are slow in performance. Number of scripts and team size are two chief factors to hurt the performance of websites by increasing the odds of duplicate scripts in one webpage and creating HTTP requests more than what is needed.
In Internet Explorer, duplicate external scripts are not cacheable. Loading a page generates a couple of HTTP requests and more HTTP requests emerge from the reloading of the page. These HTTP requests are not only excessive but also wasteful leading to wastage of time for users. Implementing a script management module in the templating system is a trick to avoid the use of duplicate scripts. Using different Script tags in the HTML page of a website can prevent the insertion of the same scripts for multiple times.
There is more in the offing for your benefit. So look forward to my next blog…..


