SystemWebCachingSectionGroup.OutputCacheSettings Property

 

Gets the outputCacheSettings section contained within the configuration.

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

<ConfigurationPropertyAttribute("outputCacheSettings")>
Public ReadOnly Property OutputCacheSettings As OutputCacheSettingsSection

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 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
Dim outputCacheSettings _
As OutputCacheSettingsSection = _
cachingSectionGroup.OutputCacheSettings

' Display the number of existing 
' profiles.
Dim profilesCount As Integer = _
outputCacheSettings.OutputCacheProfiles.Count
msg = String.Format( _
"Number of profiles: {0}" + _
ControlChars.Lf, profilesCount.ToString())

Console.Write(msg)

.NET Framework
Available since 2.0
Return to top
Show: