System.Web.UI.WebControls.XmlDataSource.CacheDuration Property

Gets or sets the length of time, in seconds, that the data source control caches data it has retrieved.

Syntax

[System.ComponentModel.DefaultValue(0)]
public virtual int CacheDuration { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

The System.Web.UI.WebControls.XmlDataSource control automatically caches data when the following applies:

Any change to the XmlDataSource.Data property or the contents of the file that contains the XML data causes the cache to be invalidated.

By default, the XmlDataSource.CacheDuration property is set to 0, which indicates an indefinite cache, and the data source will cache data until the XML file that it depends on is changed.

The behavior of the cache is governed by a combination of the duration and the XmlDataSource.CacheExpirationPolicy setting. If XmlDataSource.CacheExpirationPolicy is set to System.Web.UI.DataSourceCacheExpiry.Absolute, the System.Web.UI.WebControls.XmlDataSource control caches data on the first data retrieval operation, holds it in memory for the amount of time specified by XmlDataSource.CacheDuration, and invalidates it after the time has lapsed. The cache is then refreshed upon the next operation. If XmlDataSource.CacheExpirationPolicy is set to System.Web.UI.DataSourceCacheExpiry.Sliding, the data source control caches data on the first data retrieval operation, but resets the time window that it holds the cache for upon each subsequent operation. The cache will only expire if there is no activity for a time equal to the XmlDataSource.CacheDuration since the last data retrieval.

Requirements

Namespace: System.Web.UI.WebControls
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0