ASP.NET 2.0 : Nothing but Caching - All about the new Caching features in ASP.NET 2.0

Its long time since I wrote about Whidbey and particularly after the release of Beta 2, the focus of Developers has been much towards Whidbey. So I thought of writing about one of my favourite topics - Caching.

Caching has been a concept for study for a long time and I have heard about people who are doing their Doctorate Research in the field of Caching.

Much to the ease of developers, enabling Caching for your ASPX Page was as simple as specifying it in the Page Directive in .NET 1.x versions. To know the amount of work involved in enabling Caching prior to .NET, during the ASP days, check
This Article

But, to the surprise of all the Developers, Microsoft released the .NET 1.X versions with the System.Web.Caching.Cache class as a Sealed Class. The possible reason for that is, (according to information from a popular speaker) they had the vision to improve it a lot for the subsequent version which is Whidbey. They didn't want people to inherit the class and write their own customizations just to avoid issues, when they migrate from 1.X versions to Whidbey.

Having said that, Caching has been improved a lot in Whidbey. In .NET 1.x versions, you just had 3 options

1. Output Cache - Where you specify the cache in the Page Directive with properties such as VarybyParam, Duration etc.,

2. Fragment Cache - Where you specify the cache in the Usercontrols (again you do an Output Cache) but for the individual controls just to have static as well as dynamic sections of your web page.

3. Using the Cache API, you can do it from the code by manually adding and removing items from the Cache. You have to use this method if you want to set dependencies of your Database Table changes.

However, in Whidbey, you have a whole set of new features. Just to list them down:

1.
SQL Cache Notification
2. Using the Disk Output Cache
3. Post-cache Substitution
4. SQL Cache Invalidation
5. Cache Configuration


and much more.....

In the forthcoming articles, we will examine each of the New features extensively.

Cheers and Happy Caching !!!

Print | posted on Wednesday, June 8, 2005 12:25 PM

Comments on this post

No comments posted yet.

Your comment:

 (will show your gravatar)