How to truly improve the performance of ASP. NET websites

Source: Internet
Author: User

Article Source

Preface

How can we make Asp.net websites fly faster and have better performance? -- This is a problem that many developers often think about. I sometimes perform a lot of tests or ask someone to help collect some data, hoping to verify the suggestions of some experts on the Internet or prove my conjecture.

Theoretically, we hope to develop websites with the best performance, but can the company afford the cost? This is a common contradiction in practice. How to properly use known skills is the most meaningful topic in practice.

This article lists some optimization experiences and solutions. I have the honor to read some high-qualityArticle. I would like to emphasize that many parts of my work are not the result of my individual work, but I fully support and agree to do so and do not dare to enjoy it exclusively. I hope to encourage others to grow together.

IIS settings

If your IIS server does not need to access the Internet, disable the generatepublisherevidence certificate in the Certificate Revocation List (CRL) machine. config to cancel the Authenticode binary file (CRL) Check of the list.

Refer to the following article:

Http://msdn.microsoft.com/zh-cn/library/bb629393.aspx

Enable IIS compression (HTTP compression). By default, neither iis7.x nor iis6. This helps you increase bandwidth usage efficiency. Enabling compression improves the transmission speed between IIS and browsers that enable compression. Especially for mobile devices, compression can improve performance.

Static files only

Dynamic applications onlyProgramResponse

Static file and dynamic application response

IIS provides the following compression options:

Note: compressing dynamic application responses affects CPU resources because IIS does not cache the compressed version of dynamic output.

Because dynamic compression consumes a lot of CPU time and memory resources, you should only use it on servers that meet the following conditions: the network connection speed is very slow, but there is excess CPU time.

Unlike dynamic responses, you can cache compressed static responses without compromising the performance of CPU resources.

Static file Optimization

Try to merge static content of a file (such as a JS file or a CSS file ). This facilitates faster download of such files, ideally merged into a single JS and CSS file.

Load CSS first and then Javascript

Avoid using width height in HTML, for example,

CodeOptimization

Make sure that viewstate is disabled by default and enabled only when it is actually needed. Disabling viewstate can fundamentally reduce the page size and significantly increase the page loading time.

Enable ASP. NET output cache. Unfortunately, it may take you time to study the aspx pages one by one.

Enable the Web service output cache. Your web service always returns the same result under any given input parameter. You can use this cache.

If you use ASP. NET Ajax, make sure that <compilation DEBUG = "false"/> is set in Web. config. This avoids "expensive" parameter verification on the client and server.

Tools

Use yslow to measure the webpage loading time. If necessary, I will introduce how to use yslow. Here are a few examples to help you understand:

Firebug-this is another powerful tool, and you can easily get articles on how to use it.

Others

If the application needs to deserialize any data (including web services) from XML, use sgen.exe (XML serialization Program Generator tool) to generate an assembly in advance. When the XML serialization Program generator is not used, xmlserializer generates serialization code and a serialization Assembly for each type each time the application runs.

You can refer to the following article to learn more about sgen:

Http://msdn.microsoft.com/zh-cn/library/bk3w6240%28v=VS.100%29.aspx

Reference: http://blogs.msdn.com

Link: http://www.cnblogs.com/multiplesoftware/archive/2011/02/08/1949809.html

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.