i

ASP.Net A Complete Guide

Optimizing Your ASP.NET Application

  • Use caching for that information that is rapidly requested. Cache the complete pages or portion of the Web pages if the content of that page is too large.

  • Use data caching to increase the application performance instead of accessing the data from the database or file.

  • Keep a watch on the SQL side by Optimize the SQL query performance.

  • Add indexes as and when required — use stored procedure instead of manually writing the query in the .net application.

  • Request for only a limited number of records. In order to improve performance, we could consider getting partial data.

  • Use Async call as and when required.

  • Use the connection pooling so that the connections can be re-used.

  • Dispose of/release the objects from the method.

  • Use Bundling: It means to combine multiple files like the script, CSS files, etc. to a single file so that there will be fewer requests by the browser. It helps to improve the page load performance.

  • Use Magnification: This helps to minimize the size of requested resources by trimming and shortening the variable names, whitespaces, etc.

  • Use of Page.IsPostBack, as and when required, it minimizes the duplicate processing.

  • User "foreach" loop instead of "for" loop.

  • Avoid using ViewState to facilitate faster page loads.

  • Do practice of using Server.Transfer instead of Response.Redirect because of Response.Redirect sends a meta tag to the client that makes the client send a new request to the Server by using the new URL. Server.Transfer avoids this re-direction by making a server-side call.