49,772 Members
2 added today
334,046 Resources
771 added today

All Devdex   All Gurus  

Speeding up ASP.NET Web Applications
Author: Deepak Kumar Vasudevan
Rating:
Visits: 4985

524_Speeding_ASPNET_src.zip
Discuss in Newsgroups

Introduction

We normally use Web.Config to store and retrieve common settings for our application, including database connection strings. For dynamic database driven sites, almost for every user control that needs a database connection, there is a lookup on Web.config.

The Catch With Config Files

Like any other File Operations, Config Files also put a need for a (minimal) I/O operation, which on a high traffic site might be a problem on performance. While the file structure is an XML and retrieval is eased with friendly classes like ConfigurationSettings etc, the underlying principle of I/O operation and the cost however remains.

Solution with ASP.NET Caching

ASP.NET comes with an excellent Caching strategy and way the pages, variables and objects are cached is really meticulous. One can also configure how long should an object remain in Cache etc. Here we would present a simpler solution for the abovesaid Config File Reading problem with the help of Cache.

We would first check whether the Item already exists in Cache or not. If yes, then the request for the item is returned from Cache. If the item does not exist in Cache, then an I/O operation to the file is performed and the value is inserted to the Cache. The item is then returned from Cache. For items like ConnectionString, since the cache hit ratio would be very high on a database-intensive web site/application, there is a significant performance gain in terms of atleast config file reading and I/O operation.

Conclusion

I hope the above article would be really useful for ASP.NET/C#/VB.NET developer fraternity worldwide in making effective use of Web.Config and ASP.NET Web Caching strategies.

Visit my guru profile

Visitor Comments

Anonymouse User 2 Well actually, this is more like a 5 minute tip th...
Ahmed Kahwaji it give me a big pricture only , with explination ...
Manfred Pohler In additon to the anonymous post I want to add: ...
Alvin Bruney This directly applies to me. I can see immediate b...
Anonymous User Just in case you haven't noticed, Web.config file ...

 

Rate this Article







	
	
	



ASP.NET Shopping Cart
Unlimited items/categories
Unlimited options/choices
Ecommerce toolkit for .NET!

ASP ArticlesThis category has been added to your weekly newsletter
ASP Web Sites
ADSI & WSH BooksThis category has been added to your weekly newsletter
FREE ComponentsThis category has been added to your weekly newsletter
ASP EventsThis category has been added to your weekly newsletter
ASP HeadlinesThis category has been added to your weekly newsletter

CSharp ArticlesThis category has been added to your weekly newsletter
C# Web SitesThis category has been added to your weekly newsletter

SQL ArticlesThis category has been added to your weekly newsletter
SQL Events
SQL HeadlinesThis category has been added to your weekly newsletter
SQL Jobs

Jobs in CaliforniaThis category has been added to your weekly newsletter

XML ArticlesThis category has been added to your weekly newsletter
XML BooksThis category has been added to your weekly newsletter
XML Web Sites
XML Tutorials

free asp host

"Alex Homer"This search has been added to your weekly newsletter

Edit My Favorites Edit Profile & Favorites

 




Developersdex Home | ASP | C# | SQL | VB | XML | Gurus
Add Your Link | Add Your Code | FAQ | Advertise | Link To Us | Contact Us |
Copyright © 2010 Developersdex™. All rights reserved.