SystemWebCachingSectionGroup.OutputCacheSettings Property

Definition

Gets the outputCacheSettings section contained within the configuration.

[System.Configuration.ConfigurationProperty("outputCacheSettings")]
public System.Web.Configuration.OutputCacheSettingsSection OutputCacheSettings { get; }

Property Value

The OutputCacheSettingsSection object.

Attributes

Examples

The following code example shows how to obtain the OutputCacheSettingsSection object from the configuration file of an existing Web application.


// Get the .<outputCacheSettings> section
OutputCacheSettingsSection outputCacheSettings=
    cachingSectionGroup.OutputCacheSettings;

// Display the number of existing 
// profiles.
int profilesCount = 
    outputCacheSettings.OutputCacheProfiles.Count;
msg = String.Format(
"Number of profiles: {0}\n",
profilesCount.ToString());

Console.Write(msg);

Remarks

The OutputCacheSettingsSection object refers to the outputCacheSettings section of the configuration file.

The output cache settings enable or disable disk-based persistent output cache, define the location for persisting the data to be cached, and specify the maximum size of the cache per application.

ASP.NET allows you to cache multiple versions of a page response declaratively by using attributes of the @ OutputCache directive and programmatically using the properties and methods of the HttpCachePolicy class.

You can achieve the same results by configuring the application using the OutputCacheSettingsSection or the OutputCacheProfile type.

Applies to

Product Versions
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

See also