views:

74

answers:

1

Working on a legacy ASP.NET application we've found that ASP.NET session gets used for caching some objects, but for some objects Microsoft.Practices.EnterpriseLibrary.Caching gets used.

Is there any reason to use Microsoft.Practices.EnterpriseLibrary.Caching over standard ASP.NET Session?

Edit

In my scenario, the Enterprise Library caching is actually being used to cache per-user data by appending the ASP.NET Session ID to the cached item's key.

+5  A: 

Session and Cache are different concepts.

If you want to share the object between all users of your site you should use Cache while Session is for storing user specific data.

So your question should not be:

Is there any reason to use Microsoft.Practices.EnterpriseLibrary.Caching over standard ASP.NET Session?

but:

Is there any reason to use Microsoft.Practices.EnterpriseLibrary.Caching over standard ASP.NET Cache?

and the answer to this question as always is: it depends on your scenario. This article provides an overview of where can the Caching Application Block be used and what issues does it try to resolve.

Darin Dimitrov
If the question is the latter, one reason to use the caching application block is if you share assemblies (that require caching) between web apps and windows apps.
JohnC