HttpRuntimeSection.EnableKernelOutputCache Propriedade
Definição
Importante
Algumas informações dizem respeito a um produto pré-lançado que pode ser substancialmente modificado antes de ser lançado. A Microsoft não faz garantias, de forma expressa ou implícita, em relação à informação aqui apresentada.
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.