Using Isolated and In Memory Caching

Topics: Caching Application Block
Nov 24, 2008 at 10:46 PM
Hi All,

I'm looking at the caching application block particularly for its isolated storage.  I implemented a cache of my own for a smart client that pulls back large amounts of data from an analysis services cube.  I'm starting to use too much memory on the client though so I thought the caching application block might help.  Can you configure the caching application block with in memory limits while still storing everything you want in the isolated storage? I couldn't tell from the reading so far  but what I really need is an in memory cache where part of it can be dumped to isolated storage when the memory limit is hit, but I still want to pull those pieces back into memory at a later time withouth going back to the cube.  Does anyone know if this can be accomplished using the enterprise library cache?

Thanks for any help,

Nov 25, 2008 at 4:52 AM
You would need to add 2 CacheManagers in your configuration.  If you add the Caching Application Block to your configuration, it will automatically have a CacheManager.  Add another one and configure it to use an IsolatedStorage.  Each CacheManager has a MaximumElementsInCacheBeforeScavenging property which you can set to limit the number of items in a cache.  You can compare the Count property of the CacheManager against this property to allow you to decide where to cache the item.

Sarah Urmeneta
Global Technology & Solutions
Avanade, Inc.