HttpRuntimeSection.EnableKernelOutputCache Propriedade

Definição

Recebe ou define um valor que indica se a cache de saída está ativada.

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 Propriedade

true se a cache de saída estiver ativada; caso contrário, false. O valor predefinido é true.

Atributos

Exemplos

O exemplo seguinte mostra como utilizar a EnableKernelOutputCache propriedade.

// 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

Observações

Para armazenar em cache uma resposta, é necessário cumprir os seguintes critérios:

  • A cache deve ser explicitamente ativada por uma diretiva de página ou pela API de cache.

  • A cache deve ter uma política de expiração para que o kernel saiba quando descartá-la.

  • A cache não pode ter cabeçalhos ou parâmetros variáveis.

  • O pedido não deve exigir qualquer autenticação.

Note

Esta propriedade é relevante apenas quando o Serviços de Informação Internet (IIS) versão 6.0 ou posterior está instalado.

Aplica-se a

Ver também