Summary of ASP. NET page performance optimization solutions

Source: Internet
Author: User


1. Use Page. ispostback to reduce the number of page replies
2. Avoid using server controls. If server controls are used and some controls do not need to maintain their statuses, you can set their attributes to enableviewstate = false;
If the status view does not need to be maintained for the entire page control, you can set the status vision of the entire page to false:
The Code is as follows: <% @ page enableviewstate = "false" %>
3. If the data access layer contains a large number of String concatenation, use the stringbulider class first.
4. Page Cache Optimization
A. Use Page cache and fragment Cache
<% @ Outputcache duration = "5" varybyparam = "NONE" %>
<% @ Outputcache duration = 60 varybyparam = "textbox1, textbox2" %>
Note: Duration sets the cache expiration time;
Varbyparam is used to set whether the parameter changes. If none is used, all parameters use the same cache,
When textbox1 is set, it is cached based on different textbox1 values. When there are multiple parameters, the cache should be combined;
B. API cache (used by cache objects)
5. Use stored procedures
6. Optimize Query statements
7. Disable debugging mode during deployment
8. In terms of databases, indexes can be created if the data volume is large.

The above is an online excerpt. You are welcome to correct and supplement it. Thank you!

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.