ASP speed trick five
One of the techniques: Improve the efficiency of using the Request collection to access an ASP collection to extract a value of time, take up the process of calculating the resources. Because this operation contains a series of searches for related collections, this is much slower than accessing a local variable. Therefore, if you intend to use a value in the Request collection multiple times in the page, you should consider storing it into a partial variable. For example, the code is written into the following form to speed up the script engine processing speed: start = request.form ("title") strfirstname = request.form ("firstname") strlastname = request.form ("Lastname") if len ("lastname) IF LEN (STRTITLE) strTitle = strTitle & "" If strFirstName = "" Then strFullName = strTitle & "" & strLastName Elseif Len (strFirstName) = 1 Then strFullName = strTitle & strFirstName & "." & strLastName Else strFullName = strTitle & strFirstName & "" & strLastName END IF Tips: Direct access to the appropriate collection If nothing is not selected, do not use strpage = request ("page") to get parameters, because this searches all sets in order - QueryString, Form, Cookies, ClientCertificate, ServerVarible until the name of the first match value is found. This is lower than that of directly accessing appropriate collection efficiency, and is unsafe, unless it is absolutely guaranteed that this value does not appear in another collection. For example, it may be desirable to search for the web server name that meets the customer request, which is implemented in the Request.ServerVarables collection in each query. However, if other collections also include values called "server_name" (key names are not case sensitive), when using Request ("Server_Name", the error result is obtained. All in all, the appropriate collection should be accessed directly as much as possible. Tips 3: Use the response.isclientConnected property before the time of operation, using response.isclientConnected is a useful way to observe whether the user is still connected to the server and is being loaded into the ASP creation. If the user disconnects or stops downloading, we don't have to waste the server's resource to create a web page, because the buffer content will be discarded by IIS. Therefore, for those web pages that require a lot of time calculations or resources, it is worth checking whether the tourists have departed in each stage: ... code to create first part of the page if response.isclientconnected the response.flush Else Response.end end if ... Code to create Next Part of page Tips: Optimize ADO operation in ASP usually, data constitutes the actual content of the web site.