Export (0) Print
Expand All

HttpRuntimeSection.EnableKernelOutputCache Property

Gets or sets a value that indicates whether output caching is enabled.

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

<ConfigurationPropertyAttribute("enableKernelOutputCache", DefaultValue := True)> _
Public Property EnableKernelOutputCache As Boolean
Dim instance As HttpRuntimeSection 
Dim value As Boolean 

value = instance.EnableKernelOutputCache

instance.EnableKernelOutputCache = value

Property Value

Type: System.Boolean
true if output caching is enabled; otherwise, false. The default value is true.

In order to cache a response, the following criteria need to be met:

  • Caching must be explicitly enabled by a page directive or by the caching API.

  • Caching must have an expiration policy so that the kernel knows when to discard it.

  • Caching cannot have any variable headers or parameters.

  • The request must not require any authentication.


This property is relevant only when Internet Information Services (IIS) version 6.0 or later is installed.

The following example shows how to use the EnableKernelOutputCache property.

' Get the current EnableKernelOutputCache property value.
Response.Write("EnableKernelOutputCache: " & _
  configSection.EnableKernelOutputCache & "<br>")

' Set the EnableKernelOutputCache property to true.
configSection.EnableKernelOutputCache = True

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

© 2014 Microsoft