Why use shared cache?
There is no more efficient way to increase the scalable performance of applications then the use caching to unload deeper layers.
>> Shared Cache>> Getting Started
Video
We have created 3 short video's to demonstrate how easy it is to use indeXus.Net Shared Cache
All files have been created with SCREEN2EXEvery easy and free tool to create video's.
Download
you can download the solution which we used for the screen-cast : NowWeUseSharedCacheDemoApp.zip
Points to consider while you adding shared cache to an existing application
the below example are taken from the provider example application
- check the cache before reading from your datasource
- put data into cache after reading from data source
- clear or update cache item when updating your datasource
public Common.Country GetByName(string name)
{
// create a unique key for this item.
string key = string.Format(cacheKeyCountryByName, name);
// 1 - check the cache before reading from the data source
Common.Country result = Common.Util.CacheGet<Common.Country>(key);
if (result == null)
{
foreach (Common.Country country in this.GetAll(false))
{
if (name.Equals(country.Name))
{
result = country;
break;
}
}
// 2 - put data into cache after reading from the data source
Common.Util.CacheAdd(key, result);
}
return result;
}
|