
518
|
Chapter 24: The System.Web.Caching Namespace
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
CacheItemPriority
System.Web.Caching (system.web.dll)
serializable
enum
Priorities are hints that can optimize cache scavenging. Essentially, if the ASP.NET
engine decides to remove cache items because memory is scarce, it will remove items
with a lower priority cost first. The CacheItemPriority enumeration also includes a NotRemov-
able member that you can use to prevent ASP.NET from removing an object from the
cache automatically when memory is low.
Hierarchy
System.Object ➝ System.ValueType ➝ System.Enum(System.IComparable, System.IFor-
mattable, System.IConvertible)
➝ CacheItemPriority
Passed To
Cache.{Add( ), Insert( )}
CacheItemRemovedCallback
System.Web.Caching (system.web.dll)
serializable
delegate
Functions with the CacheItemRemovedCallback signature can be used to respond to the onRe-
moveCallback when an item is dropped from the cache. For example, this could allow you
to perform related cleanup tasks. You are provided with the cache object, its key, and
the reason why it was removed (using the CacheItemRemovedReason enumeration).
To specify that a given method should be used for the onRemoveCallback, create a CacheItem-
RemovedCallback delegate that points to the method, and pass it as an argument to the
Cache.Insert( ) method.
Passed ...