namespace Nop.Core.Caching; /// /// Represents a manager for caching between HTTP requests (long term caching) /// public partial interface IStaticCacheManager : IDisposable, ICacheKeyService { /// /// Get a cached item. If it's not in the cache yet, then load and cache it /// /// Type of cached item /// Cache key /// Function to load item if it's not in the cache yet /// /// A task that represents the asynchronous operation /// The task result contains the cached value associated with the specified key /// Task GetAsync(CacheKey key, Func> acquire); /// /// Get a cached item. If it's not in the cache yet, then load and cache it /// /// Type of cached item /// Cache key /// Function to load item if it's not in the cache yet /// /// A task that represents the asynchronous operation /// The task result contains the cached value associated with the specified key /// Task GetAsync(CacheKey key, Func acquire); /// /// Get a cached item. If it's not in the cache yet, return a default value /// /// Type of cached item /// Cache key /// A default value to return if the key is not present in the cache /// /// A task that represents the asynchronous operation /// The task result contains the cached value associated with the specified key, or the default value if none was found /// Task GetAsync(CacheKey key, T defaultValue = default); /// /// Get a cached item as an instance, or null on a cache miss. /// /// Cache key /// /// A task that represents the asynchronous operation /// The task result contains the cached value associated with the specified key, or null if none was found /// Task GetAsync(CacheKey key); /// /// Remove the value with the specified key from the cache /// /// Cache key /// Parameters to create cache key /// A task that represents the asynchronous operation Task RemoveAsync(CacheKey cacheKey, params object[] cacheKeyParameters); /// /// Add the specified key and object to the cache /// /// Key of cached item /// Value for caching /// A task that represents the asynchronous operation Task SetAsync(CacheKey key, T data); /// /// Remove items by cache key prefix /// /// Cache key prefix /// Parameters to create cache key prefix /// A task that represents the asynchronous operation Task RemoveByPrefixAsync(string prefix, params object[] prefixParameters); /// /// Clear all cache data /// /// A task that represents the asynchronous operation Task ClearAsync(); }