Click or drag to resize
CacheHelper Class
Provides helper methods for caching.
Inheritance Hierarchy
SystemObject
  CMS.BaseCoreMethods
    CMS.BaseAbstractHelper
      CMS.BaseAbstractHelperCacheHelper
        CMS.HelpersCacheHelper

Namespace: CMS.Helpers
Assembly: CMS.Helpers (in CMS.Helpers.dll) Version: 13.0.131
Syntax
C#
public class CacheHelper : AbstractHelper<CacheHelper>

The CacheHelper type exposes the following members.

Constructors
  NameDescription
Public methodCacheHelper
Top
Fields
  NameDescription
Public fieldStatic memberAPI_CACHE_MINUTES
Cache minutes for caching the system data in API. 1 hour by default
Public fieldStatic memberCSS_KEY
CSS caching key.
Public fieldStatic memberDEFAULT_CACHE_DEPENDENCIES
Default cache dependencies constant.
Public fieldStatic memberDefaultCacheItemPriority
Cache item priority.
Public fieldStatic memberDUMMY_KEY
Dummy item.
Public fieldStatic memberFILENODE_KEY
File node caching key.
Public fieldStatic memberFULLPAGE_KEY Obsolete.
Full page caching key.
Public fieldStatic memberMACRO_KEY
Macro cache key.
Public fieldStatic memberNO_CACHE_DEPENDENCIES
No cache dependencies constant.
Public fieldStatic memberSEPARATOR
Cache item separator.
Top
Properties
  NameDescription
Public propertyStatic memberAllowCacheByCulture
If true, the cache allows separate keys by culture.
Public propertyStatic memberAllowCacheByUserName
If true, the cache allows separate keys by user name.
Public propertyStatic memberAlwaysCacheFiles
Gets if files are always cached on client, even outside the live site.
Public propertyStatic memberAlwaysCacheResources
Gets if resources are always cached on client, even outside the live site.
Public propertyStatic memberBaseCacheKey
Returns the base cache key (created with all parameters considered to be valid for proper caching).
Public propertyStatic memberClientCacheRequested
Gets if the client specified cache settings in request.
Public propertyStatic memberCurrentCachePrefix
Current context name
Public propertyStatic memberDependencyChanged
DependencyChanged items count (removed by the dependency).
Public propertyStatic memberExpired
Expired items count (removed by the system for expiration reasons).
Public propertyStatic memberMultiplePrefixesUsed
If true, multiple cache prefixes were used
Public propertyStatic memberPhysicalFilesCacheMinutes
Gets the expiration time in minutes that should be set for the physical files in the client cache.
Public propertyStatic memberProgressiveCaching
If true, progressive caching is enabled, meaning that two threads accessing the same code share the result of an internal operation. True by default.
Public propertyStatic memberRemoved
Removed items count (removed correctly by the system).
Public propertyStatic memberUnderused
Underused items count (removed sooner for memory reasons).
Top
Methods
  NameDescription
Public methodStatic memberAdd(String, Object, CMSCacheDependency, DateTime, TimeSpan)
Mirror to Cache.Add().
Public methodStatic memberAdd(String, Object, CMSCacheDependency, DateTime, TimeSpan, CMSCacheItemPriority, CMSCacheItemRemovedCallback, Boolean)
Mirror to Cache.Add().
Protected methodAddInternal
Mirror to Cache.Add().
Public methodStatic memberBuildCacheItemName
Builds the cache item name from the given parts
Public methodStatic memberCacheTData(FuncTData, CacheSettings)
Wraps the operation to a cached section. This method supports progressive caching and is able to distribute unhandled exceptions to other simultaneously running threads.
Public methodStatic memberCacheTData(FuncCacheSettings, TData, CacheSettings)
Wraps the operation to a cached section. This method supports progressive caching and is able to distribute unhandled exceptions to other simultaneously running threads.
Public methodStatic memberCacheAsyncTData(FuncTaskTData, CacheSettings)
Asynchronously loads data. If multiple threads are loading the same data, only one thread executes the load, stores the result into cache and the result is distributed to other waiting threads. If an exception is thrown during loadMethodAsync execution, the exception is distributed as well. No data are cached in such a case.
Public methodStatic memberCacheAsyncTData(FuncCacheSettings, TaskTData, CacheSettings)
Asynchronously loads data. If multiple threads are loading the same data, only one thread executes the load, stores the result into cache and the result is distributed to other waiting threads. If an exception is thrown during loadMethodAsync execution, the exception is distributed as well. No data are cached in such a case.
Public methodStatic memberCacheAsyncTData(FuncCancellationToken, TaskTData, CacheSettings, CancellationToken)
Asynchronously loads data. If multiple threads are loading the same data, only one thread executes the load, stores the result into cache and the result is distributed to other waiting threads. If an exception is thrown during loadMethodAsync execution, the exception is distributed as well. No data are cached in such a case.
Public methodStatic memberCacheAsyncTData(FuncCacheSettings, CancellationToken, TaskTData, CacheSettings, CancellationToken)
Asynchronously loads data. If multiple threads are loading the same data, only one thread executes the load, stores the result into cache and the result is distributed to other waiting threads. If an exception is thrown during loadMethodAsync execution, the exception is distributed as well. No data are cached in such a case.
Public methodStatic memberCacheEnabled
Returns true if the content caching is enabled.
Public methodStatic memberCacheImageAllowed
Checks if the file attachment is below the maximum file size used for caching.
Public methodStatic memberCacheImageEnabled
Returns true if the image caching is enabled.
Public methodStatic memberCacheImageMinutes
Cache image minutes.
Public methodStatic memberCacheMinutes
Cache content minutes.
Public methodStatic memberClearCache
Clears the entire system cache.
Public methodStatic memberClearCache(String, Boolean, Boolean)
Clears the cache content starting with given string. Clears also full page cache (including persistent) when called on website.
Public methodStatic memberClearCSSCache
Clear the CSS cache
Public methodStatic memberClearFileNodeCache
Clear the cache for the file document nodes.
Public methodStatic memberClearFullPageCache Obsolete.
Clear the full page cache (output cache) of the pages.
Protected methodClearFullPageCacheInternal Obsolete.
Clear the full page cache (output cache) of the pages.
Public methodStatic memberClientCacheMinutes
Client cache minutes for the processed content (both files and pages).
Public methodStatic memberCompactCache
Tries to remove the specified percentage of items from the underlying cache. The return value indicates whether compacting was performed (i.e. whether the underlying cache supports compacting).
Protected methodCreateCacheDependencyInternal
Creates the cache dependency with specified parameters
Public methodStatic memberEnsureDummyKey
Ensures the dummy key with the given name
Public methodStatic memberEnsureKey
Ensures the specified cache key.
Public methodStatic memberGetBaseCacheKey
Returns the base cache key (created with all parameters considered to be valid for proper caching).
Public methodStatic memberGetCacheDependencies
Processes the dependencies string. Returns default dependencies if the source is null or empty. If source is NO_CACHE_DEPENDENCY constant, then method also returns this constant. When source is specified and contains DEFAULT_CACHE_DEPENDENCIES constant, then this constant indicates that default dependencies should be appended to the source. The DEFAULT_CACHE_DEPENDENCIES also remains in the string so other processes can insert their default dependencies.
Public methodStatic memberGetCacheDependency(ICollectionString)
Creates the cache dependency from the given keys.
Public methodStatic memberGetCacheDependency(String)
Creates the cache dependency from the given keys.
Public methodStatic memberGetCacheDependency(String)
Creates the cache dependency from the given keys.
Public methodStatic memberGetCacheDependency(ListString, ICollectionString)
Creates the cache dependency from the given keys.
Public methodStatic memberGetCacheDependency(String, String)
Creates the cache dependency from the given keys.
Public methodStatic memberGetCacheItemName(String, Object)
Gets the cache item string.
Public methodStatic memberGetCacheItemName(Boolean, String, Object)
Gets the cache item string.
Public methodStatic memberGetCacheItemRows
Creates a list of all cache items to display in the Debug application.
Public methodStatic memberGetCacheItemsString
Gets the cache items string (item names separated by semicolon)
Public methodStatic memberGetCombinedCacheItems
Gets combined cache items for setting and default items
Public methodStatic memberGetCultureCacheKey
Gets the cache key for current culture
Public methodStatic memberGetCultureCacheKey(String)
Gets the cache key for the given culture
Public methodStatic memberGetDependencyCacheKeys
Parses the string and returns the array of the cache dependency keys.
Protected methodGetEnumeratorInternal
Gets the enumerator for the cache items.
Public methodStatic memberGetFileCacheDependency
Creates the cache dependency from the given file path.
Public methodStatic memberGetFullKey
Gets the full cache key with the prefix
Protected methodGetFullKeyInternal
Gets the full cache key with the prefix
Public methodStatic memberGetInnerValue
Gets the inner value for the cache item
Protected methodGetInternal
Gets the item from the cache.
Public methodStatic memberGetItem
Gets item from cache.
Public methodStatic memberGetUserCacheKey
Gets the cache key for current user
Public methodStatic memberGetUserCacheKey(String)
Gets the cache key for current user the given user
Protected methodInsertInternal
Inserts the item into the cache.
Public methodStatic memberMaxCacheFileSize
Maximum size of the file that is allowed to be cached in kilobytes.
Public methodStatic memberRegisterAutomaticCallback Obsolete.
Registers the automatic callback that is executed at the specific time
Public methodStatic memberRegisterDependencyCallbackTTarget
Registers a cache callback for given list of cache dependencies
Public methodStatic memberRemove
Removes object from cache.
Public methodStatic memberRemoveDependencyCallback
Registers a cache callback for given list of cache dependencies
Protected methodRemoveInternal
Removes the item from the cache.
Public methodStatic memberRevalidateClientCache
Returns whether the client cache should be revalidated by the call to the server.
Public methodSetAsDefaultHelper
Sets this object as the default helper
(Inherited from AbstractHelperHelperType.)
Public methodStatic memberTouchKey(String)
Touches the cache key to drop the dependencies.
Public methodStatic memberTouchKey(String, Boolean, Boolean)
Touches the cache key to drop the dependencies.
Public methodStatic memberTouchKey(String, Boolean, Boolean, DateTime)
Touches the cache key to drop the dependencies.
Public methodStatic memberTouchKey(String, Boolean, Boolean, DateTime, Boolean)
Touches the cache key to drop the dependencies.
Protected methodTouchKeyInternal
Touches the cache key to drop the dependencies.
Public methodStatic memberTouchKeys(IEnumerableString)
Touches the cache key to drop the dependencies.
Public methodStatic memberTouchKeys(IEnumerableString, Boolean, Boolean)
Touches the cache key to drop the dependencies.
Public methodStatic memberTouchKeys(String, Boolean, Boolean)
Touches the cache keys separated by new line to drop the dependencies.
Protected methodTouchKeysInternal
Touches the cache key to drop the dependencies.
Public methodStatic memberTryGetItem(String, Object)
Returns true if the cache contains the item with specified key.
Public methodStatic memberTryGetItem(String, Boolean, Object)
Returns true if the cache contains the item with specified key.
Public methodStatic memberTryGetItemOutputType(String, OutputType)
Returns true if the cache contains the item with specified key.
Public methodStatic memberTryGetItemOutputType(String, Boolean, OutputType, Boolean)
Returns true if the cache contains the item with specified key.
Top
See Also