OutputCacheSettings Property

SystemWebCachingSectionGroup.OutputCacheSettings Property

Gets the outputCacheSettings section contained within the configuration.

Namespace:  System.Web.Configuration
Assembly:  System.Web (in System.Web.dll)

public OutputCacheSettingsSection OutputCacheSettings { get; }

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.

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=

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


Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0

Community Additions

© 2016 Microsoft