
Beginning ASP.NET 2
.0.pdf








14
Performance
Throughout the book you’ve learned a range of techniques to help you build web sites, and really concentrated on the possibilities; what controls and code you can use to produce great functionality for your site. One thing you haven’t looked at, though, is how to make your site perform as well as it possibly can. After all, it doesn’t matter how great your site looks; if it performs badly it fails. Internet users are an impatient lot and expect sites to be fast.
Although performance should be addressed throughout the design and building of a site, this isn’t always practical, especially for the beginner. So this chapter revisits some of the earlier pages to see how they can be improved, and discusses the techniques that can be used to create the best performing sites.
In particular, this chapter looks at the following:
How to design and test for performance
The techniques to use in ASP.NET pages and data handling to ensure the fastest possible pages
What caching is and how it can be used
Let’s start with the things you can do to either existing code or new code that you write.
Simple Techniques
Several simple things are easy to do and provide good performance, as well as being good design techniques and aiding future development work and maintenance. After all, writing applications isn’t just about getting the best from them now, but also getting the best from them in the future.
Being able to fix and update web applications easily is just as much a part of development as producing the application in the first place. This section on simple techniques looks at the following:
How to dispose of resources once they are no longer required.
How to ensure connecting to a database is done in the best possible way.
How using stored procedures can improve data access performance.
