System.Web.Caching vs. Enterprise Library Caching Block

Posted by ESV on Stack Overflow See other posts from Stack Overflow or by ESV
Published on 2008-08-22T06:07:29Z Indexed on 2010/06/09 15:22 UTC
Read the original article Hit count: 589

For a .NET component that will be used in both web applications and rich client applications, there seem to be two obvious options for caching: System.Web.Caching or the Ent. Lib. Caching Block.

  • What do you use?
  • Why?

System.Web.Caching

Is this safe to use outside of web apps? I've seen mixed information, but I think the answer is maybe-kind-of-not-really.

I don't expect to use one of its highlights, SqlCacheDependency, but the addition of CacheItemUpdateCallback in .NET 3.5 seems like a Really Good Thing.

Enterprise Library Caching Application Block

  • other blocks are already in use so the dependency already exists
  • cache persistence isn't necessary; regenerating the cache on restart is OK

Some cache items should always be available, but be refreshed periodically. For these items, getting a callback after an item has been removed is not very convenient. It looks like a client will have to just sleep and poll until the cache item is repopulated.

Memcached for Win32 + .NET client

What are the pros and cons when you don't need a distributed cache?

© Stack Overflow or respective owner

Related posts about caching

Related posts about cache