ASP.NET Hosting Tips - How to Increase Your ASP.NET Performance for SEO - Windows ASP.NET Core Hosting 2024 | Review and ComparisonWindows ASP.NET Core Hosting 2024 | Review and Comparison

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.

jaguar

Increasing ASP.NET performance for SEO

I have been using ASP.NET programming language for many years and I always learn how to increase my asp.net speed. With great ASP.NET performance, then it will increase our website visibility, audience, and profit. And google like the site with high performance. Here are few tips from me how 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"
AutoEventWireup="false" Inherits="WebApplication1.WebForm1"
EnableSessionState="false" %>

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.

<configuration>
<system.web>
<trace enabled="false" pageOutput="false" />
<trace enabled="false" requestLimit="10" pageOutput="false" traceMode="SortByTime" localOnly="true"/>
<compilation debug="false" />
</system.web>
</configuration>

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.

public ShowOrdersTablePage()
{
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.

Conclusion

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!

[crp]

Leave a Reply