Assembly: System.Web (in system.web.dll)
/** @property */ public String get_CacheKeyDependency () /** @property */ public void set_CacheKeyDependency (String value)
public function get CacheKeyDependency () : String public function set CacheKeyDependency (value : String)
Property ValueA key that identifies all cache objects created by the ObjectDataSource.
The CacheKeyDependency property can be set to any arbitrary string value.
All cache objects are explicitly expired when the key is expired. This allows you to invalidate cache entries that are created by the ObjectDataSource from your own page code programmatically.
The ObjectDataSource control supports data caching. While data is cached, calls to the Select method retrieve data from the cache rather than from the business object that the ObjectDataSource works with. When the cache expires, the Select method retrieves data from the business object, and then caches the data again.
If you are not familiar with the Data Access features in ASP.NET 2.0, you should read some of these topics before continuing:
The ObjectDataSource control automatically caches data when the EnableCaching property is set to true and the CacheDuration property is set to a value greater than 0, which indicates the number of seconds that the cache stores data before the cache entry is discarded. A value of 0 indicates an infinitely long cache.
You can set the CacheKeyDependency property to create a dependency between all cache entries that are created by the ObjectDataSource control and the key. You can expire all the cache entries programmatically at any time by expiring the key. Expire the key by using the System.Web.Caching.Cache.Remove(System.String) method with the current CacheKeyDependency value as the parameter.
A unique cache entry is created for every combination of the CacheDuration, CacheExpirationPolicy, TypeName, SelectMethod, and SelectParameters properties. Multiple ObjectDataSource controls can use the same cache entries in scenarios where they load data using the same type, method, and parameters.