Geeks With Blogs

AzamSharp Some day I will know everything. I hope that day never comes.

When designing a web application we need to squeeze the performance out of our application in every possible way. Here are some tips on how to increase the performance of your web application.

1) Caching: This is on the top of the list. Caching when used wisely can increase the performance of the web application by more than 100%! Steven Smith is an expert in caching and has provided many articles and videos in which he showed how to use caching effectively. Check out this video on Caching on DNR TV.

2) ViewState: ViewState is used by all the ASP.NET controls. Several times we are using the control on the page whose ViewState is enabled but we are not using the ViewState feature which means we don't really care about the state of the control. In those scenarios it is better to turn off the ViewState and increase performance. If you are using a grid like control i.e GridView, Repeater, DataList or DataGrid then make sure you are only using ViewState when required or else turn it off.

3) SessionState: Although it does not make much difference but we are trying to squeeze out performance on everything possible. If you are not using Session on the page then you can turn if off by saying EnabledSessionState = "false" on the page directive. If you are using session on the page but only reading the data out of the session then you can set it to EnabledSessionState = "readonly".

4) JavaScript in JS Files: Don't embed your JavaScript in the page. This will increase the page size and the user has to download the JavaScript everytime he/she visits the page. A good idea is to put the JavaScript in the JS file which is downloaded on the user's computer and cached by the browser. This way the page size will be small and the user will use the cached JS file.

(I have experienced some AJAX based scenarios in which putting the JavaScript on the page is necessary)

5) CSS Styles in CSS File: Just like JavaScript you should also place your styles in the CSS file. This ways the user can download the CSS file and will use the cached version of the CSS file.

6) Literals to Display Data: Usually, we use the Label control to display some data on the page. Label is rendered as a SPAN tag. This increases the size of the page due to the inclusion of the SPAN tag. If you want to display something on the page and you are not concered about the styling then you can use the Literal control which is rendered without the span tag hence keeping the page size small.

If you have any tips then please share!

Posted on Thursday, December 6, 2007 8:12 AM | Back to top

Comments on this post: Improving Web Application Performance

# re: Improving Web Application Performance
Requesting Gravatar...
Use compression! either at the IIS level or as a http module
Left by Edmund on Dec 06, 2007 9:48 AM

# re: Improving Web Application Performance
Requesting Gravatar...
GZIP, Expires Tag, JavaScript Minify, CSS minify
Left by Zack Owens on Dec 06, 2007 1:40 PM

# re: Improving Web Application Performance
Requesting Gravatar...

Thanks for the tips!

Left by Mohammad Azam on Dec 06, 2007 3:16 PM

# re: Improving Web Application Performance
Requesting Gravatar...
Thanks Zack Owens for the Tip!
Left by Guess on Dec 10, 2007 1:03 AM

Your comment:
 (will show your gravatar)

Copyright © Mohammad Azam | Powered by: