Performance is a feature. You need to design for performance up front, or you get to rewrite your application later on. That said, what are some good strategies for maximizing the performance of your Active Server Pages (ASP) application?
This article presents tips for optimizing ASP applications and Visual Basic® Scripting Edition (VBScript). Many traps and pitfalls are discussed. The suggestions listed in this article have been tested on http://www.microsoft.com and other sites, and work very well. This article assumes that you have a basic understanding of ASP development, including VBScript and/or JScript, ASP Applications, ASP Sessions, and the other ASP intrinsic objects (Request, Response, and Server).
Often, ASP performance depends on much more than the ASP code itself. Rather than cover all wisdom in one article, we list performance-related resources at the end. These links cover both ASP and non-ASP topics, including ActiveX® Data Objects (ADO), Component Object Model (COM), databases, and Internet Information Server (IIS) configuration. These are some of our favorite links-be sure to give them a look.
- Cache Frequently-Used Data on the Web Server
- Cache Frequently-Used Data in the Application or Session Objects
- Cache Data and HTML on the Web Server's Disks
- Avoid Caching Non-Agile Components in the Application or Session Objects
- Do Not Cache Database Connections in the Application or Session Objects and Using the Session Object Wisely
- Encapsulate Code in COM Objects & Acquire Resources Late, Release Early
- Out-of-Process Execution Trades off Performance for Reliability
- Option Explicit, Local Variables and Script Variables
- Avoid Redimensioning Arrays
- Use Response Buffering
- Batch Inline Script and Response.Write Statements
- Check Connection, Using the OBJECT Tag, TypeLib Declarations
- Take Advantage of Your Browser's Validation Abilities & Enable Browser and Proxy Caching
- Avoid String Concatenation in Loops
- More on Fine Tuning
Senior Consultant, Microsoft Consulting Services
George V. Reilly
Microsoft IIS Performance Lead
Adapted from an article by Nancy Cluts
Developer Technology Engineer
Original Resource: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnasp/html/asptips.asp