EasyHostingASP.NET | Best and cheap ASP.NET Hosting. In this post we will show you how to Increase Your ASP.NET Performance for SEO. A challenge faced by web developers and designers is creating engaging, responsive, interactive web pages that load quickly and keep the user happy. With high performance site, then our site will be ranked higher by Google. In this tutorial, I will show some tips how to increase your site performance in ASP.NET. The better ranking most likely lead to more click throughs, increasing the website’s visibility, audience, and profit.
A few tips to increase your ASP.NET performance :
1. Disable Session State
Disable Session State if you’re not going to use it. By default it’s on. You can actually turn this off for specific pages, instead of for every page:
<%@ Page language="c#" Codebehind="WebForm1.aspx.cs"
You can also disable it across the application in the web.config by setting the <sessionState> mode value to Off.
2. Avoid Server-Side Validation
Try to avoid server-side validation, use client-side instead. Server-Side will just consume valuable resources on your servers, and cause more chat back and forth.
3. Use HTTPServerUtility.Transfer instead of Response.Redirect
Redirect’s are also very chatty. They should only be used when you are transferring people to another physical web server. For any transfers within your server, use .transfer! You will save a lot of needless HTTP requests.
4. Turn off Tracing
Tracing is awesome, however have you remembered to turn it off? If not, make sure you edit your web.config and turn it off! It will add a lot of overhead to your application that is not needed in a production environment.
<trace enabled="false" pageOutput="false" />
<trace enabled="false" requestLimit="10" pageOutput="false" traceMode="SortByTime" localOnly="true"/>
<compilation debug="false" />
5. Avoid Exceptions
Avoid throwing exceptions, and handling useless exceptions. Exceptions are probably one of the heaviest resource hogs and causes of slowdowns you will ever see in web applications, as well as windows applications. Write your code so they don’t happen! Don’t code by exception!
6. Turn Off ViewState
If you are not using form postback, turn off viewsate, by default, controls will turn on viewsate and slow your site.
this.Init += new EventHandler(Page_Init);
private void Page_Init(object sender, System.EventArgs e)
this.EnableViewState = false;
7. Use Paging
Take advantage of paging’s simplicity in .net. Only show small subsets of data at a time, allowing the page to load faster. Just be careful when you mix in caching. How many times do you hit the page 2, or page 3 button? Hardly ever right! So don’t cache all the data in the grid! Think of it this way: How big would the first search result page be for “music” on Google if they cached all the pages from 1 to goggle
8. Use ControlState and not ViewState for Control
If you followed the last tip, you are probably freaking out at the though of your controls not working. Simply use Control State. Please check Microsoft example how to use ControlState.
There are hundreds more where these came from, however I really feel that these are the most critical of the speed improvements you can make in ASP.net that will have a dramatic impact on the user experience of your application. If you find benefits on this article, please kindly share it!
- ASPHostPortal vs Site5 – Best Windows ASP.NET Hosting Comparison - September 29, 2017
- Best , Cheap Umbraco 7.7.1 Hosting Recommendation - September 28, 2017
- ASP.NET Web Forms Connection Resiliency and Command Interception - September 27, 2017