Tuesday, May 11, 2010

Think .Net Cache = System.Web.Caching? .Net 4 has a present for you, System.Runtime.Caching.

Robert MacLean's blog - .NET Baby Steps: Part VII – Caching

“.NET has had one out of the box way to do caching in the past, System.Web.Caching. While a good system it suffered from two issues. Firstly it was not extensible, so if you wanted to cache to disk or SQL or anywhere other than memory you were out of luck and secondly it was part of ASP.NET and while you could use it in WinForms it took a bit of juggling.

The patterns & practises team saw these issues and have provided a caching application block in their Enterprise Library which has been used by everyone who did not want to re-invent the wheel. Thankfully from .NET 4 there is a caching system now included in the framework which solves those two issues above. This is known as System.Runtime.Caching.

image …”

.NET Framework Class LibrarySystem.Runtime.Caching Namespace

“The System.Runtime.Caching namespace contains types that let you implement caching in NET Framework applications.

The output caching functionality and types in the System.Runtime.Caching namespace are new in .NET Framework version 4. The classes in this namespace provide a way to use caching facilities like those in ASP.NET, but without a dependency on the System.Web assembly.

The caching types that are provided in this namespace offers the following features:

  • Caching is accessible to all .NET Framework applications, not just ASP.NET.

  • Caching is extensible.

  • You can create custom caching providers. For example, instead of using the default in-memory cache engine, you can create custom providers that store cache data in databases, in custom objects, or in the file system.

image …”

So much to learn… (which is why I LOVE this job! :)

BTW, while you’re there checking out Robert’s post, make sure you check out the rest of his very cool “.Net Baby Steps” posts.

 

Related Past Post XRef:
Microsoft Enterprise Library 5.0 and Unity 2.0 RTW (& EntLib 3.x, 4.x to 5.0, Unity 1.x to 2 Migration Guide)

1 comment:

  1. I just wanted to say THANK YOU
    for your blog, valuable info every day.

    Thank you!

    ReplyDelete

NOTE: Anonymous Commenting has been turned off for a while... The comment spammers are just killing me...

ALL comments are moderated. I will review every comment before it will appear on the blog.

Your comment WILL NOT APPEAR UNTIL I approve it. This may take some hours...

I reserve, and will use, the right to not approve ANY comment for ANY reason. I will not usually, but if it's off topic, spam (or even close to spam-like), inflammatory, mean, etc, etc, well... then...

Please see my comment policy for more information if you are interested.

Thanks,
Greg

PS. I am proactively moderating comments. Your comment WILL NOT APPEAR UNTIL I approve it. This may take some hours...