How to Enhance ASP program performance (1)
2000-08-10 · Gan Ganping · Yesky
Brief introduction
Performance is a very important feature. You need to design the performance metrics beforehand, otherwise you'll have to rewrite the program for that. is to imagine how to optimize the implementation of ASP programs?
This paper presents some techniques for optimizing ASP application and VBScript, and many techniques and defects have been discussed. The recommendations listed here have been tested on http://www.microsoft.com and other sites and are working very well. This article assumes that you have the basics of ASP development, including VBScript or jscript,asp applications, ASP sessions, and other ASP built-in objects (Request,response and server).
Typically, the performance of an ASP is much more than just the ASP code itself! Performance-related resources are listed at the end of this article, which includes ASP and non-ASP parts, including ActiveX Data Objects (ADO), Component Object Model (COM), database, And the configuration of Internet Information Server (IIS). In addition to these, there are some very good links worth seeing.
Tip 1: Caching frequently used data on a Web server
Typically, an ASP page retrieves data from a background store and then forms the result in Hypertext Markup Language (HTML). Retrieving data from memory is much faster than from a background storage device, regardless of the speed of the database. Reading data from your local hard disk is usually very fast. Therefore, improving performance can be achieved by caching the data on the server, either by caching the data in memory or by the local hard drive.
Caching is the classic "space for Time" compromise. If the cache is properly cached, you can see significant performance improvements. In order for caching to be effective, it is necessary to ensure that cached data is often reused and computationally cumbersome. Caching a cache full of stale data is a waste of memory.
Data that is infrequently changed is a good object for caching because it does not need to be considered at any time when the data is updated for synchronization operations. combo boxes, reference tables, DHTML code, extended Markup language strings, menus, and site configuration variables (including data source name dsns,internet protocol address IP and Web path) are good caching objects. Note: You want to cache the data expression instead of the data itself. If an ASP page changes frequently and is laborious to cache (such as the entire product catalog), consider generating HTML instead of describing it every time a request occurs.
Tip 2: Cache frequently used data in application or session objects
The application and session objects in ASP are convenient containers for caching data in memory. You can assign data to application and session objects, which will remain in memory for the duration of the HTTP call. The data in the session is serviced for each user, and the data in the application is shared by all users.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.