London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!
AI OnAI Off
London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!
// 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