*Tip 1: Use GLOBAL.ASA for application layer files
Load the file into an application layer array in GLOBAL.ASA instead of reading the file on the page by using the ASP file system object.
GLOBAL.ASA can be used to specify event scripts, or to declare objects that have session or application scope. It does not display directly to the user, but stores information and objects of application-level events. Then you can point to the application layer array where the data is stored through the page. This means that every server requests to read the file, not every user reads it once per page. You can run a separate ASP file to refresh the contents of the application layer array, and you can also consider using dictionary objects (see Tips 9).
This trick can greatly speed up your system.
So how will this technique be implemented?
If you are a scriptwriter, you must use the file system object to read the file into an array or a dictionary object. Then read the file in GLOBAL.ASA and put the array (with the file content you read) or dictionary object into the application layer declaration. This allows users to access information in an array or dictionary object without having to submit information through an ASP request at a time.
But maybe you will think, "What should I do if the content in the cache needs to be updated? I bet it won't be used." Actually, it is not the case. If the content in the cache needs to be updated, you can call an administrator-accessible ASP file containing an executable application lock command script, update the cache information in an array or dictionary object, and finally execute the application lock command.
*Tip 2: Remove HTML comments from product source code (IIS3.0 applies)
Not bad, it is definitely difficult to understand if it is difficult to write. Just kidding, this does not mean that you need to remove all HTML comments (script comments are pretty good), and a large range of HTML text can be copied to the client in batches. In this way, your script will run faster on IIS3.0 (in IIS4.0, HTML comments will no longer cause slower execution).
*Tip 3: Multiple Response.write statements
If you are writing output results in format in several places in the code, then consider combining these results into one piece and writing them out in a Response.write statement. Then you look at the composition of your HTML code and vbscript script. Don't spread HTML and vbscript scripts too much, try to write them into blocked HTML and vbscript scripts.
*Tip 4: Use the <OBJECT> flag to illustrate the object
If you need to point to objects that may not be used, then use the <OBJECT> flag to illustrate, instead of using Server.createobject. Using Server.createobject will generate the object immediately. If you don't use it in the future, it will be a waste of resources.
*Tip 5: Use local (local) variables as much as possible
(The following new trick will replace the earlier "Defining variables in one line" published, which contains some wrong views):