Microsoft.Extensions.Caching.Memory Gets or sets an absolute expiration date for the cache entry. Gets or sets an absolute expiration time, relative to now. Gets or sets how long a cache entry can be inactive (e.g. not accessed) before it will be removed. This will not extend the entry lifetime beyond the absolute expiration (if set). Gets the instances which cause the cache entry to expire. Gets or sets the callbacks will be fired after the cache entry is evicted from the cache. Gets or sets the priority for keeping the cache entry in the cache during a memory pressure triggered cleanup. The default is . An implementation of using a dictionary to store its entries. Creates a new instance. The options of the cache. Cleans up the background collection events. Gets the count of the current entries for diagnostic purposes. This is called after a Gen2 garbage collection. We assume this means there was memory pressure. Remove at least 10% of the total entries (or estimated memory?). Remove at least the given percentage (0.10 for 10%) of the total entries (or estimated memory?), according to the following policy: 1. Remove all expired items. 2. Bucket by CacheItemPriority. ?. Least recently used objects. ?. Items with the soonest absolute expiration. ?. Items with the soonest sliding expiration. ?. Larger objects - estimated by object graph size, inaccurate. Policy: ?. Least recently used objects. ?. Items with the soonest absolute expiration. ?. Items with the soonest sliding expiration. ?. Larger objects - estimated by object graph size, inaccurate. Extension methods for setting up memory cache related services in an . Adds a non distributed in memory implementation of to the . The to add services to. The so that additional calls can be chained. Adds a non distributed in memory implementation of to the . The to add services to. The to configure the provided . The so that additional calls can be chained. Adds a default implementation of that stores items in memory to the . Frameworks that require a distributed cache to work can safely add this dependency as part of their dependency list to ensure that there is at least one implementation available. should only be used in single server scenarios as this cache stores items in memory and doesn't expand across multiple machines. For those scenarios it is recommended to use a proper distributed cache that can expand across multiple machines. The to add services to. The so that additional calls can be chained. Registers a callback that fires each time a Gen2 garbage collection occurs, presumably due to memory pressure. For this to work no components can have a reference to the instance.