ASP skills highlights (official authority version)

zhaozj2021-02-16  188

Tip 21: Enable browser and proxy cache default, ASP disables the cache in your browser and proxy. This will make sense, because ASP is born to dynamically, with potentially sensitive information. If one does not need to refresh the page each time, the browser and proxy cache should be enabled. This allows the browser and agent to use a cache copy of a page in a certain period of time, which can be controlled. The cache can significantly reduce the server load, and the user feels better. Which dynamic page can cache? For example: Weather pages, updated every 5 minutes. List the home page of the news or the home page of the news release, update 2 times a day. Public fund operator list, basic statistics hours update once. Note that using a browser or agent cache, only a few hits are recorded on the web server. If you want to accurately measure all pages or post ads, you may not like to use browser and proxy cache. The browser cache is controlled by the web server to the HTTP of the browser. The ASP provides two mechanisms for send titles. To set the page to a certain number of minutes in the future, set the response.expires property. The following example notifies the browser: The content is overdue after 10 minutes: <% response.expires = 10%> Setting response.expires is negative or 0 disable cache. It must be used to overcome the difference between the server clock and the browser clock using a large negative number, such as -1000 (greater than one day). The second attribute response.expiresabsain, allows for the setup time to expire: <% response.expiresabsolute = #may 31,2001 13:30: 15 #%> If you don't want to set up expiration time using the Response object, you can mark tag Write an HTML, usually written in inside the HTML file. Some browsers will respond to this directive, but the agent will not. Finally, you can identify whether the content is valid for the HTTP proxy cache, use the Response.cacheControl property. Set the properties to "public", allowing the agent to cache content. <% Response.cachecontrol = "public"%> By default, this property is set to "Private". Note that the proxy cache should not be enabled for a page that displays a user-specific data because the agent may serve the user page service for other users.

Tips 22: Use Server.Transfer as much as possible to replace the response.redirect response.Redirect to inform the browser, request a different page. This function is often used to redirect the user to the login or error page. Since it is redirected to force a new page request, the browser must do twice to the round trip to the web server, and the web server must handle additional requests. IIS 5.0 introduces a new function, Server.Transfer, the function performs different ASP pages that are transmitted to the same server. This avoids additional, from the browser to the round trip of the web server, thereby improving the overall system performance while improving the response time for the user. Check out the new direction in the redirection (English), which discusses Server.Transfer and Server.execute. You can also view a full list of new features about IIS 5.0 and ASP 3.0 in LeveRaging ASP IN IIS 5.0. (English) Tips 23: Tips related to the tail of the directory URL tail are, must be set to the URL tail of the directory (/). If the slash is omitted, the browser will ask a request to the server, and only notify it to find a directory. Then the browser issues a second request, add a slash at the end of the URL, then the server will respond to the default document of that directory, or if the default document is not enabled, the directory list is responded to the directory list. Added a slash, save the first unused round trip. Out of the user's friendly, maybe I want to slightly slightly slightly at the end of the name of the display. For example, write: http://msdn.microsoft.com/workshop It also applies to point to Web Site Home URL: Please use the following: , don't use .

Tip 24: Avoid using server variable access server variables will cause a special request to the server to make special requests to the server, and then collect all server variables, but not the one you need. This seems to retrieve a special information from the folder in the moldy attic. When you want a message, you must get the folder before accessing the information. This is the same as the first request server variable when the request server variable is requested. Subsequent access to other server variables does not cause performance access. Never access unqualified Request objects (for example, Request ("Data"). For items that are not in Request.Cookies, Request.Form, Request.QueryString, or Request.ClientCertificate, there is an implicit call to Request.ServerVariables. Request.serVariables collection is much slower than other collections.

Tips 25: Upgrade to the latest and best version of the system components often upgrade, it is recommended to upgrade to the latest and best versions. It is best to upgrade to Windows 2000 (also, IIS 5.0, ADO 2.5, MSXML 2.5, Internet Explorer 5.0, VBScript 5.1, and JScript 5.1). IIS 5.0 and ADO 2.5 have realized very good performance on multiprocessor computers. Under Windows 2000, ASP can expand to four processors or more, but in IIS 4.0, ASP cannot extend to more than two processors. The more scripts and ADOs used in the application, the greater the performance improvement after upgrading to Windows 2000. If you haven't upgraded to Windows 2000, you can upgrade to the latest version of SQL Server, ADO, VBScript, and JScript, MSXML, Internet Explorer, and NT 4 Service Packs. They all improve performance and enhance reliability. Tips 26: Adjusting the web server has many IIS adjustment parameters to improve site performance. For example, using IIS 4.0, we often find an increase of ASP's ProcessorthreadMax parameters (see IIS document) to get great benefits, especially in terms of back-end resources, such as databases or other intermediate layers, such as Screen-Scrapers, Site. In IIS 5.0, you will find that open ASP THREAD Gating is more effective than trying to find a best setting for AspProcessorthReadmax. The following adjustment IIS (English) is a good information. The best configuration depends on (in other factors) application code, the hardware running on it and the client's workload. The only way to find the best setting is to run performance tests, which will bring us next skill.


New Post(0)