Coding for Website Performance
Some web developers may think coding for performance is a superfluous feature and they may often leave it for the last phase of development (if there is any extra time). When you begin building medium and large websites, the last thing you’d want is an angry phone call from your client because the site is not scaling well. And what would be even worse is to find out that the site is performing horribly, not because you need to upgrade your hosting, but rather because you were lazy in your coding and did not take the necessary steps to ensure the site runs as efficiently as possible and now you have to go back and recode your DAL and god knows what else!
The truth is, coding for performance should be built into the site from day one. Not only does it help make your clients happy but it also goes hand-in-hand with good coding practices.
Let’s take a simple example using the presentation layer of a website. On the front-end, I always do my utmost to use semantic HTML and CSS for my layouts. This makes my web pages load faster because most of the presentational markup has been stripped out and now the pages are smaller in file size. Once the user downloads the CSS file it’s cached so he only needs to download each new web page, which are much smaller in size than if I had a bunch of nested tables or other unnecessary presentation elements. For further proof, checkout the now famous and somewhat comical article “The problem with using tables”.
So I’ve stated why CSS is good for performance, but how does this coincide with my other point that coding for performance goes hand-in-hand with good coding practices? If you use CSS for layouts not only will your sites load faster, but you will have increased maintainability, better cross-browser compliance, better accessibility, and even have better Search Engine Optimization. This article was not intended to be entirely written about CSS, but I felt it was a great topic to reinforce my point.
For back-end coding, the steps you need to take to ensure good performance are numerous and most of which also enforce good coding practices. Here at Atomic Design, we generally do all of our back-end work in ASP.NET 2.0. Here is a great article that outlines the steps you need to take to ensure high performance when making ASP.NET 2.0 websites. And here is another informative article on Writing High-Performance Web Applications from MSDN.
In addition to the items mentioned in the above articles, there are many other steps that you can take, such as using asynchronous pages, only using https when necessary, using gzip compression, using css compression tools, and much, much more.
