/// <summary> /// Adds a minimum set of ASP.NET output cache dependencies for a view that contains data from pages with the specified runtime type. /// When any page of the specified runtime type is created, updated or deleted, the corresponding output cache item is invalidated. /// </summary> /// <typeparam name="T">The runtime type that represents pages, i.e. it is derived from the <see cref="CMS.DocumentEngine.TreeNode"/> class.</typeparam> public void AddDependencyOnPages <T>() where T : TreeNode, new() { if (!mCacheEnabled) { return; } var className = mContentItemMetadataProvider.GetClassNameFromPageRuntimeType <T>(); var dependencyCacheKey = String.Format("nodes|{0}|{1}|all", mSiteName, className); AddCacheItemDependency(dependencyCacheKey); }
/// <summary> /// Adds a minimum set of ASP.NET output cache dependencies for a view that contains data from pages of the specified runtime type. /// When any page of the specified runtime type is created, updated or deleted, the corresponding output cache item is invalidated. /// </summary> /// <typeparam name="T">Runtime type that represents pages, i.e. it is derived from the <see cref="TreeNode"/> class.</typeparam> public void AddDependencyOnPages <T>() where T : TreeNode, new() { if (!mCacheEnabled) { return; } var className = mContentItemMetadataProvider.GetClassNameFromPageRuntimeType <T>(); var dependencyCacheKey = String.Format("nodes|{0}|{1}|all", SiteContext.CurrentSiteName.ToLowerInvariant(), className); AddCacheItemDependency(dependencyCacheKey); AddCacheItemDependency("cms.adhocrelationship|all"); AddCacheItemDependency("cms.relationship|all"); }
private string GetDependencyCacheKeyForPage(Type type) { return(String.Format("nodes|{0}|{1}|all", mSiteName, mContentItemMetadataProvider.GetClassNameFromPageRuntimeType(type))); }
private string GetDependencyCacheKeyForPage(Type type) { return(String.Format(PagesCacheDependencyAttribute.KEY_FORMAT, SiteContext.CurrentSiteName.ToLowerInvariant(), mContentItemMetadataProvider.GetClassNameFromPageRuntimeType(type))); }
private string GetDependencyCacheKeyForEmptyPagesRuntimeType <T>() where T : TreeNode, new() { var className = mContentItemMetadataProvider.GetClassNameFromPageRuntimeType <T>(); return(CacheDependencyKeyProvider.GetDependencyCacheKeyForPageType(SiteContext.CurrentSiteName, className)); }