DataCacheHelper.GetCachedX<>() and dependencies

Stefan Lorenz asked on March 19, 2014 04:40


I understand adding dependencies to cached data when using CacheHelper.Add():


But I wonder how to set dependencies when using one of the DataCacheHelper.GetCachedX methods? They don't accept a CMSCacheDependency object, but instead want a dependency callback (the 2nd last parameter). All examples I found have this parameter set to null.

Would anyone mind giving me a quick example how to define a cache dependency when using GetCachedX() ?

Thanks in advance Stefan

Recent Answers

Roman Koníček answered on April 14, 2014 08:52

Hi Stefan,

Setting dependencies via DataCacheHelper.GetCachedX methods is obsolete, you should use CacheHelper.Add method to store the content in the cache ( or you can also use CachedSection (

Also these two articles below might be useful for you:

Do you have any specific reason, why you need to use the methods you have mentioned? If you can describe me your aim in more detail, I would help with the solution.

Best Regards, Roman Konicek

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.