System.Web.Caching 命名空间

System.Web.Caching 命名空间提供类,用于缓存服务器上经常使用的数据。 The System.Web.Caching namespace provides classes for caching frequently used data on the server.

AggregateCacheDependency

组合存储在 ASP.NET 应用程序的 Cache 对象中的项与一组 CacheDependency 对象之间的多个依赖关系。Combines multiple dependencies between an item stored in an ASP.NET application's Cache object and an array of CacheDependency objects. 此类不能被继承。This class cannot be inherited.

Cache

实现 Web 应用程序的缓存。Implements the cache for a Web application. 此类不能被继承。This class cannot be inherited.

CacheDependency

在存储于 ASP.NET 应用程序的 Cache 对象中的项与文件、缓存键、文件或缓存键的数组,或另一个 CacheDependency 对象之间建立依赖关系。Establishes a dependency relationship between an item stored in an ASP.NET application's Cache object and a file, cache key, an array of either, or another CacheDependency object. CacheDependency 类监视依赖关系,以便在任何这些对象发生更改时,自动删除缓存的项。The CacheDependency class monitors the dependency relationships so that when any of them changes, the cached item will be automatically removed.

CacheInsertOptions

表示包含缓存插入选项的类型。Represents the type that contains cache insert options.

CacheStoreProvider

提供要作为 MemoryCache 使用的默认对象缓存实现插入其中的缓存存储所需的基接口。Provides the base interface required of any cache store that wants to be plugged in as the default object cache implementation used by MemoryCache.

DatabaseNotEnabledForNotificationException

在未启用 SQL Server 数据库以支持与 SqlCacheDependency 类关联的依赖项时引发的异常。The exception that is thrown when a SQL Server database is not enabled to support dependencies associated with the SqlCacheDependency class. 此类不能被继承。This class cannot be inherited.

FileResponseElement

表示存储为文件的输出缓存项一部分。Represents part of an output-cache entry, stored as a file.

HeaderElement

表示来自输出缓存的响应中包含的单个 HTTP 标头。Represents a single HTTP header that is included in a response from the output cache.

MemoryResponseElement

表示存储在内存中的输出缓存项一部分。Represents part of an output-cache entry that is stored in memory.

OutputCache

可通过编程方式访问网站的配置文件中指定的输出缓存提供程序。Provides programmatic access to the output-cache providers that are specified in the configuration file for a Web site.

OutputCacheProvider

充当一个基类,该类包含用于实现输出缓存提供程序的抽象方法。Serves as a base class that contains abstract methods for implementing an output-cache provider.

OutputCacheProviderAsync

提供了异步的 OutputCacheProvider 类。Provides an asynchronous OutputCacheProvider class.

OutputCacheProviderCollection

表示为网站配置的输出缓存提供程序的集合。Represents the collection of output-cache providers that are configured for a Web site.

OutputCacheUtility

提供用于配置输出缓存的 Helper 方法。Provides helper methods for configuring the output cache.

ResponseElement

一个抽象基类,表示输出缓存中的 HTTP 响应。An abstract base class that represents an HTTP response in the output cache.

SqlCacheDependency

在存储于 ASP.NET 应用程序的 Cache 对象中的项与特定 SQL Server 数据库表或 SQL Server 2005 的查询结果之间建立关系。Establishes a relationship between an item stored in an ASP.NET application's Cache object and either a specific SQL Server database table or the results of a SQL Server 2005 query. 此类不能被继承。This class cannot be inherited.

SqlCacheDependencyAdmin

在使用基于轮询的依赖项时,执行 SQL Server 数据库上需要的管理任务以支持 SqlCacheDependency 类。Performs administrative tasks required on a SQL Server database to support the SqlCacheDependency class when using polling-based dependencies. 此类不能被继承。This class cannot be inherited.

SubstitutionResponseElement

表示一个托管委托,调用该委托可以将动态生成的输出插入到输出缓存响应中。Represents a managed delegate that can be called to insert dynamically generated output into an output-cache response.

TableNotEnabledForNotificationException

SqlCacheDependency 类用于未为其启用更改通知的数据库表时引发的异常。The exception that is thrown when a SqlCacheDependency class is used against a database table that is not enabled for change notifications.

接口

IOutputCacheEntry

定义 HTTP 标头元素和 HTTP 响应元素的集合,这两种元素共同组成 ASP.NET 可传递给提供程序的一种输出缓存数据。Defines collections of HTTP header and response elements that together make up one kind of output-cached data that ASP.NET can pass to a provider.

枚举

CacheItemPriority

指定 Cache 对象中存储的项的相对优先级。Specifies the relative priority of items stored in the Cache object.

CacheItemRemovedReason

指定从 Cache 对象移除项的原因。Specifies the reason an item was removed from the Cache.

CacheItemUpdateReason

指定要从 Cache 对象中移除缓存项的原因。Specifies the reason that a cached item is being removed from the Cache object.

委托

CacheItemRemovedCallback

定义在从 Cache 移除缓存项时通知应用程序的回调方法。Defines a callback method for notifying applications when a cached item is removed from the Cache.

CacheItemUpdateCallback

定义回调方法,用于在删除缓存中的缓存项之前,向应用程序发出通知。Defines a callback method for notifying applications before a cached item is removed from the cache.

注解

此命名空间包括Cache类,使用户可以存储数据对象,例如哈希表和数据集的字典。This namespace includes the Cache class, a dictionary that enables you to store data objects such as hash tables and data sets. 它还提供过期功能,为这些对象和方法,使你能够添加和删除对象。It also provides expiration functionality for those objects, and methods that enable you to add and remove the objects. 可以将对象添加到缓存并依赖于其他文件或缓存条目。You can add the objects to the cache with a dependency on other files or cache entries. 在这种情况下,Cache对象可以调用的回调方法从缓存中移除对象时通知应用程序。In that case, the Cache object can invoke a callback method to notify your application when an object is removed from the cache.