In this post I am refering to
this page in the documentation.
It states:
using CMS.SiteProvider;
using CMS.GlobalHelper;
private void CachingExample()
{
DataSet data = null;
// Cache the data for 10 minutes with key "mykey"
using (CachedSection<DataSet> cs = new CachedSection<DataSet>(ref data, 10, true, null, "mykey"))
{
if (cs.LoadData)
{
data = UserInfoProvider.GetAllUsers(); // Get data from database
cs.CacheDependency = CacheHelper.GetCacheDependency("somekey"); // Cache dependency
cs.Data = data; // Save data to cache
}
}
}
Why are there two distincts key used in this code snippet?
mykey and
somekey are used. Is there something I am missing here?
What is the relation between the newly added cached section and the cache dependency?
The code works just fine, I am just wondering why two different keys are used in this case.
Any tip would be very appreciated.
Regards,