Ever wanted to throw something into the .net cache but worried about it containing stale data from Umbraco? This package ensures your objects are flushed from the .net cache when the associated umbraco content items are updated.
Simples ;)
HttpContext.Current.Cache.Add(
"key",
"value",
new UmbracoDependency(
// tickles cache only when document 1234 is updated.
new ContentDependency(1234),
//tickles cache when document 1234 and its children are updated.
new ContentDependency(1234,true),
//tickles cache when any document of document type 1235 is updated.
new AllContentOfTypeDependency(1235),
//tickles cache when any document of document type docTypeAlias is updated.
new AllContentOfTypeDependency("docTypeAlias"),
//tickles cache when any media item of media type 124 is updated.
new MediaDependency(124),
//tickles cache when any media of media type 1032 is updated.
new AllMediaOfTypeDependency(1032)
),
Cache.NoAbsoluteExpiration,
Cache.NoSlidingExpiration,
CacheItemPriority.Normal,
null
);
You can list as many Dependencies as you wish.
Currrent dependencies are as follows: