Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
AI OnAI Off
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
// Make the cache object dependent on the EPiServer
// cache, so it will be removed when new pages are
// published, deleted or we are notified by
// another server that the cache needs refreshing
String[] pageCacheDependencyKey = new String[1];
pageCacheDependencyKey[0] = DataFactoryCache.VersionKey;
CacheDependency dependency = new CacheDependency(null, pageCacheDependencyKey);
// Add to cache, without dependencies and expiration
// policies. If the cached item should be cached for
// limited time (regardsless of the cache dependency),
// add an absolute expiration date or a sliding expiration
// to the item.
// Also note, we use the Insert method that will overwrite
// any existing cache item with the same key. The Add method
// will throw an exception if an item with the same key exists.
HttpContext.Current.Cache.Insert(cacheKey, SOMETHING, dependency);
/Steve