Tag Archives: best tutorial ASP.NET Hosting

ByAlexia Pamelov

Cheap Windows ASP.NET Hosting – Tips To Boost Your ASP.NET Performance

CheapWindowsHosting.com | Best and cheap ASP.NET hosting. In this post we will explain about how to boost your ASP.NET performance.

ASP.NET is a web application server framework that has been designed to make the process of website development easier , especially for the creation of dynamic web pages . It is important to understand the usefulness of ASP.NET applications in building efficient , robust and reliable .

businessman-with-a-computer_1012-166

Below are my top 7 tips to improving ASP.net application Performance :

1 . 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.

2 . Always check Page.IsValid when using Validator Controls

So you’ve dropped on some validator controls , and you think your good to go Because ASP.net does everything for you ! Right ? Wrong ! All that happens if bad the data is received is the IsValid flag is set to false . So the make sure you check Page.IsValid before processing your forms !

3 . Deploy with Release Build

Make sure you use the Release Build mode and not Debug Build when you deploy your site to production . If you think this does not matter , think again . By running in debug mode , you are creating PDB ‘s and cranking up the timeout . Deploy Release mode and you will see the speed improvements .

4 . Pre – Compiling ASP.NET Application

When compiling an ASP.NET application project , a single assembly is created to hold all the application ‘s code but the web pages ( . Aspx ) and user controls ( . Ascx ) not compiled and be deployed as it is . In the first request ASP.NET dynamically compiles the web pages and user control and places the compiled files in the ASP.NET temporary files folder .

To reduce the time of the first request a web application can be pre-compiled , Including all the code , pages , and user controls , by using the ASP.NET compilation tool ( Aspnet_compiler.exe ) . Running this tool in production servers can reduce the delay users experience on first requests .

  • Open a command prompt in your production server .
  • Navigate to the % windir % Microsoft.Net folder
  • Navigate to either the Framework or Framework64 According to the configuration of the web application ‘s application pool .
  • Navigate to the framework version ‘s folder .
  • Enter the following command to start the compilation

Aspnet_compiler.exe – v / FullPathOfYourWebApplication

5 . 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 " % >

mode value to Off. “>You can also disable it across the application in the web.config by setting the value to Off mode .

6 . Repeater Control Good, DataList, DataGrid, and DataView controls Bad

Asp.net is a great platform , unfortunately a lot of the controls that were developed are heavy in html , and create not the greatest scaleable html from a performance standpoint . ASP.net repeater control is awesome ! Use it ! You might write more code , but you will thank me in the long run !

7 . Create Per -Request Cache

Use HTTPContect.Items to add single page load to create a per – request caching.

Best ASP.NET Core 1.0 Hosting Recommendation

asphostportal-icon-e1421832425840-120x120-e1424663413602ASPHostPortal.com provides its customers with Plesk Panel, one of the most popular and stable control panels for Windows hosting, as free. You could also see the latest .NET framework, a crazy amount of functionality as well as Large disk space, bandwidth, MSSQL databases and more. All those give people the convenience to build up a powerful site in Windows server. ASPHostPortal.com offers ASP.NET hosting starts from $1/month only. They also guarantees 30 days money back and guarantee 99.9% uptime. If you need a reliable affordable ASP.NET Hosting, ASPHostPortal.com should be your best choice.

Simpan

Simpan

ByAlexia Pamelov

Cheap Windows ASP.NET Hosting – Improve ASP.NET 5 Website Performance

CheapWindowsHosting.com | This article give you some of the best tips to improve your ASP.NET Website performance. Writing an ASP.NET application is relatively easy with the use of Rapid Application Development controls however it is just not enough to use. You should use each component wisely to get performance benefit to your ASP.NET Website. Remember that 80-90% of page load time spent on downloading all components like HTML, CSS, Script files, images, flash. Rather than looking for re-designing application architecture you should first try to organize your static contents. Below are some easy tips which helps you to achieve a bigger reduction in response times.

HTTP compression

Make sure HTTP compression is turned On. HTTP compression is a algorithm which removes extra space, redundancy from file and produce clean output. It generates smaller size and reduce weight of file than original representation. The outcome of this is reduced bandwidth and time to load page.

Although the support for compression is a feature of all modern browsers you should enable and configure or implement custom compression feature.

You can configure httpCompression tag under system.webServer in ASP.NET Web.config file or Enable HttpCompression feature in IIS.

You can also implement HttpModule to remove space and return compressed output. However it includes runtime cost to implement custom logic to remove unwanted space and redundancy. You can compress your physical files using GZipStream before deploy to production server.

Below is sample code to compress your aspx file.

private void CompressFile(string srcPath, string tarPath)
{
    using(FileStream srcStream = File.OpenRead(srcPath))
    {
        using(FileStream tarStream = File.OpenWrite(tarPath));
        {
            using(GZipStream cStream = new GZipStream(srcStream,
            CompressMode.Compress))
            {
            byte[]data = new byte[srcStream.Length];
            srcStream.Read(data, 0, data.Length);
            tarStream.Write(data, 0, data.Length);
            }
        }
    }
}

Set CacheControlMaxAge

Set CacheControlMaxAge property in Web.config file. It caches static contents like image, css, js files for particular duration. One year is recommended settings.

Below Web.config setting shows you how to configure caching for static contents

<system.webServer>
 <staticcontent>
     <clientCache cacheControlMode="UseExpires" 
           httpExpires="Tue, 30 June 2015 03:14:07 GMT"/>
 </staticcontent>
 </system.webServer>

Configure MiniProfiler

Get MiniProfiler from GitHub or use Nuget package manager and configure for your site. It is profiling library developed by StackExchange team which helps to monitor your Website performance. You can see detail execution time. Do not give an access to end user and once your testing is done remove configuration.

Recommended ASP.NET 5 Hosting Click Here

Data Controls Paging

For your Data controls like GridView, DataGrid, Repeater UI controls, make sure you are using custom or database level paging. The built in feature of control’s paging is very heavy and expensive as it has to get all the records (no matter how big is your resultset) from database and then filter it at client side as per current page number and pagesize.

When you implement custom paging you provide required page index and page size to database and database returns filtered rows as per input values. So it reduces the required bandwidth and loading time for GridView.

Client side input validations

For rich user experience it is necessary to validate user input on client side using JavaScript or jQuery. You can also use RegEx expression to make sure input data is in valid format. This provides quick feedback and makes page more responsive. Also you should provide easy to understand error messages to users.

Although client side validations are quick and responsive, do not avoid server side validations as client side validations easy to break.

Reduce data sent across the network

Reducing amount of data sent across the network can improve your application performance significantly. You can achieve this by below things

1. Combine script and css files: Try to combine all script files in single file, it reduce required number of requests to load page. If you are using any third party script file, you can copy its content to your single script file. It will save DNS look up time.

If you can not combine all scripts in one file, try to make it for one file for one domain script (e.g. make a one script file for all scripts referring from jQuery website). It reduces DNS lookup time.

Apply same tips for css files.

2. Minify script and css files: You should minify your script and css files to reduce its size. Minification will remove spaces from script or css files and replace long keyword with small characters. You can use this tool for minification.

3. Script reference: Use script references at the bottom of the page because async downloads halt when script reference is reached. Stylesheet and images can be download in async.

4. Async Scripts: Below code allows you to download script files asynchronously.

<script async src="slow.js"></script>

If clients browsers are old. This can be use for script and css files.

<script type="text/javascript">
    var link = document.createElement("link");
    link.type = "text/css"; link.rel = "stylesheet";
    link.href = "Styles/Site.min.css"; 
    document.getElementsByTagName("head")[0].appendChild(link)</script>

Content Delivery Network

Use Content Delivery Network(CDN) for hosting images and script files. These files can be cached and reduce load on server.

A content delivery network (CDN) is a bunch of web servers shared across multiple locations to deliver content more efficiently to users. Depending on user’s location and measure of network proximity server is selected for delivering content. It look for server with the fewest network hops or the server with the quickest response time.

The users location in respect to location has an impact on page load time. Deploying your content to geographically dispersed server or near to your most intended website audience.

Recommended ASP.NET 5 Hosting Click Here