IsolatedStorage BackingStore

Topics: Caching Application Block
Jun 25, 2007 at 9:04 PM
Hi,

It will be great if someone can show me the code snippet of using IsolatedStorage as backing store for caching (storing and retrieving) in a windows application.

I didn't find a single article on the web showing code-snippet for storing and retrieval of caching using IsolatedStorage as Backing store.

Thanks.

Jun 26, 2007 at 9:34 PM
Hi,

Your client code should be the same regardless of the nature of the backing store. Just configure the isolated storage backing store for your cache manager (in the configuration tool you would right click on the cache manager and add a new backing store). The configuration file should look like this:

<cachingConfiguration defaultCacheManager="Cache Manager">
<cacheManagers>
<add expirationPollFrequencyInSeconds="60" maximumElementsInCacheBeforeScavenging="1000"
numberToRemoveWhenScavenging="10" backingStoreName="Isolated Storage"
name="Cache Manager" />
</cacheManagers>
<backingStores>
<add partitionName="Foo" encryptionProviderName="" type="Microsoft.Practices.EnterpriseLibrary.Caching.BackingStoreImplementations.IsolatedStorageBackingStore, Microsoft.Practices.EnterpriseLibrary.Caching, Version=3.1.0.0, Culture=neutral, PublicKeyToken=null"
name="Isolated Storage" />
</backingStores>
</cachingConfiguration>

Hope this helps,
Fernando