Display optimization of ASP and Asp.net

Source: Internet
Author: User

 

In Asp.net, you can use the cache method to optimize your display, or dynamically generate static data. There are many methods available.

First, we will talk about the Asp.net cache method.
Caching is a way to achieve "good enough" performance without much time and analysis.
Use cache to solve some data that is frequently accessed. This solution applies to the logic page that has been built, this allows you to think about optimizing the database structure or SQL statements.
The call is very simple. Reference System. Web. caching;
Cache _ cache = new cache (); Declaration
Refer to the msdn article.
Http://msdn2.microsoft.com/en-us/library/system.web.caching.aspx
Frequently called pages can also be cached with page-level output
Applicable to pages that are not frequently changed and are in a large number of common forms

Easy to implement
To implement the page output cache, you only need to add an outputcache command to the page.
<% @ Outputcache duration = "60" varybyparam = "*" %>
Like other page commands, this command should appear at the top of the ASPX page, that is, before any output. It supports five attributes (or parameters), two of which are required.
Refer to the msdn article:
Http://msdn.microsoft.com/library/default.asp? Url =/library/en-US/cpgenref/html/cpconoutputcache. asp

If the access is very frequent, you can also consider static forms.
Dynamically generate static forms.
If the page format changes frequently, you can use XML as the middleware to work with XSL.
Reference System. XML in Asp.net
You can use system. xml. xmldatadocument _ xml = new system. xml. xmldatadocument (_ DS );
System. xml. XSL. Pipeline transform _ XSL = new system. xml. XSL. Pipeline transform ();
_ XSL. Load (system. Web. httpcontext. Current. server. mappath ("XSL. XSLT "));
System. Io. memorystream T = new system. Io. memorystream ();
_ XSL. Transform (_ xml. documentelement, null, T, null );

If you can, you can also consider starting from the page layout and using the <div> nesting does not need to wait until the HTML of the page is loaded, so it is better to experience the customer.

You can also refer to the popular Ajax for asynchronous transmission, or share some server pressure

If you can combine FSO and XML + XSL to generate static pages in ASP

In addition, you can use the component mode in ASP to encapsulate complex logic to increase the speed.

In addition, you can use stored procedures in databases to increase the speed, regardless of ASP or Asp.net.

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.