CacheItemPriority 枚举

定义

指定用于确定是否逐出某个缓存项的优先级别设置。Specifies a priority setting that is used to decide whether to evict a cache entry.

public enum class CacheItemPriority
public enum CacheItemPriority
type CacheItemPriority = 
Public Enum CacheItemPriority
继承
CacheItemPriority

字段

Default 0

指示移除缓存项没有优先级。Indicates that there is no priority for removing the cache entry.

NotRemovable 1

指示绝不应从缓存中移除某个缓存项。Indicates that a cache entry should never be removed from the cache.

注解

可以设置的唯一优先级是某个条目是否应始终保留在缓存中。The only priority that can be set is whether an entry should remain in the cache forever.

重要

如果将条目添加到具有优先级别 NotRemovable 的缓存中, 则可能会使缓存溢出, 并且可能永远不会删除这些条目。Adding an entry to the cache with a priority level of NotRemovable has the potential to overflow the cache with entries that can never be removed. 缓存实现仅应为缓存项设置 NotRemovable 优先级, 前提是它们提供从缓存中逐出此类条目以及管理缓存条目数的方法。Cache implementations should only set the NotRemovable priority for a cache entry if they provide ways to evict such entries from the cache and to manage the number of cache entries.

适用于

另请参阅