How to write excellent ASP applications (2)

Source: Internet
Author: User
Tags connection pooling file size new features odbc connection variables variable client access
Parts


  


  . Performance


  . Scalability


  . Separation of business logic and page performance


  . Reuse
by ASP or other environment

  . Transaction processing


  . Type safety


  . Accessing operating system features


  . Protection of intellectual property


  . Use Server.CreateObject in the following situations:


  . MTS Transaction Processing


  . Context Security


  . ASP internal Parts


  . OnStartPage, OnEndPage


  . Runat=server> delay object initialization using <object


  . Save to session or application variable


  


Performance


  


  . Response Buffer: Response.buffer=true


  . Close Connection and: Set connection=nothing


  . Using local variables


. Replace Server.CreateObject
with <object >

  . Do not use session and application variables


  . Do not store COM objects in session or application variables


  . Turn off script debugging


  . Avoid repeated string additions


  . Use Response.IsClientConnected
at the top of a time-consuming page

  . Using MSMQ


  . Do not store large arrays in session or application


  . Do not ReDim array


  . Assign an object of a collection type to a temporary variable


  . Reduce the maximum number of threads in the microprocessor (run Regedt32, hkey_local_machine\system\ currentcontrolset\services\w3svc\asp\parameters, Increase the ProcessorThreadMax, reduce the value, see the performance change, or increase the value. )


  . Set the AspScriptEngineCacheMax so that it equals the number of processorthreadmax*cpu. The default is 30; (Under the System path: \system32\inetsrv/adminisamples, type adsutil.vbs, set/w3svc/aspscriptenginecachemax);


  . Reduce session.timeout;


  . In MMC, set the ASP application buffering to be valid.


  


Give some work to the client:


  


  . CSS, DHTML


  . XML


  . RDS


  . Remote Scripting


  . Xmlhttp


  . Client-side validation


  . Reduce file size


  . Avoid HTTPS and SSL
as much as possible

  . Use Response.End to test performance


  


Database


  


  . Reduce access to database access;


  . The result of a cached transformation;


  . Use ODBC connection pooling and OLE DB resource pools;


  . Use a System DSN or non-DSN, and do not use DSN or file DSN;


  . Make ADO run in dual-threading mode (both-threaded): Makefre.bat;


  . A Field object using ADO;


  . GetString or getrows more quickly;


  . RDS and XML to marry the load to the client;


  . Do not use SELECT * to write fields;


. Use sq as much as possible. Server 7, do not use Access;


  . Use sq. Server features: Stored procedure, Job, Join, sort, group


  . Use sq. Analysis, optimizing the performance of SQL


  . Using index


  . Local use of name-pipes, remote use of sockets


  . Specify command Type
exactly

  


new features of IIS 5


  


  . Reliable reboot


  . ASP Performance Improvement


  . Server.Transfer is better than Server.redirect


  . Server.Execute


  . Server.GetLastError





Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.