HttpRuntimeSection.EnableKernelOutputCache Propiedad

Definición

Obtiene o establece un valor que indica si el almacenamiento en la caché de resultados está habilitado.

public:
 property bool EnableKernelOutputCache { bool get(); void set(bool value); };
[System.Configuration.ConfigurationProperty("enableKernelOutputCache", DefaultValue=true)]
public bool EnableKernelOutputCache { get; set; }
[<System.Configuration.ConfigurationProperty("enableKernelOutputCache", DefaultValue=true)>]
member this.EnableKernelOutputCache : bool with get, set
Public Property EnableKernelOutputCache As Boolean

Valor de propiedad

Es true si el almacenamiento en la caché de resultados está habilitado; en caso contrario, es false. El valor predeterminado es true.

Atributos

Ejemplos

En el ejemplo siguiente se muestra cómo usar la propiedad EnableKernelOutputCache.

// Get the current EnableKernelOutputCache property value.
Response.Write("EnableKernelOutputCache: " +
  configSection.EnableKernelOutputCache + "<br>");

// Set the EnableKernelOutputCache property to true.
configSection.EnableKernelOutputCache = true;
' Get the current EnableKernelOutputCache property value.
Response.Write("EnableKernelOutputCache: " & _
  configSection.EnableKernelOutputCache & "<br>")

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

Comentarios

Para almacenar en caché una respuesta, es necesario cumplir los siguientes criterios:

  • El almacenamiento en caché debe estar habilitado explícitamente por una directiva de página o por la API de almacenamiento en caché.

  • El almacenamiento en caché debe tener una directiva de expiración para que el kernel sepa cuándo descartarlo.

  • El almacenamiento en caché no puede tener ningún encabezado o parámetro de variable.

  • La solicitud no debe requerir ninguna autenticación.

Nota:

Esta propiedad solo es relevante cuando se instala Internet Information Services (IIS) versión 6.0 o posterior.

Se aplica a

Consulte también