SystemWebCachingSectionGroup.OutputCacheSettings Propriedade

Definição

Obtém a outputCacheSettings secção contida na configuração.

public:
 property System::Web::Configuration::OutputCacheSettingsSection ^ OutputCacheSettings { System::Web::Configuration::OutputCacheSettingsSection ^ get(); };
[System.Configuration.ConfigurationProperty("outputCacheSettings")]
public System.Web.Configuration.OutputCacheSettingsSection OutputCacheSettings { get; }
[<System.Configuration.ConfigurationProperty("outputCacheSettings")>]
member this.OutputCacheSettings : System.Web.Configuration.OutputCacheSettingsSection
Public ReadOnly Property OutputCacheSettings As OutputCacheSettingsSection

Valor de Propriedade

O objeto OutputCacheSettingsSection.

Atributos

Exemplos

O seguinte exemplo de código mostra como obter o OutputCacheSettingsSection objeto a partir do ficheiro de configuração de uma aplicação Web existente.


// Get the .<outputCacheSettings> section
OutputCacheSettingsSection outputCacheSettings=
    cachingSectionGroup.OutputCacheSettings;

// Display the number of existing 
// profiles.
int profilesCount = 
    outputCacheSettings.OutputCacheProfiles.Count;
msg = String.Format(
"Number of profiles: {0}\n",
profilesCount.ToString());

Console.Write(msg);
' 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)

Observações

O OutputCacheSettingsSection objeto refere-se à outputCacheSettings secção do ficheiro de configuração.

As definições de cache de saída ativam ou desativam a cache persistente de saída baseada em disco, definem a localização para persistir os dados a armazenar em cache e especificam o tamanho máximo da cache por aplicação.

ASP.NET permite armazenar em cache múltiplas versões de uma resposta de página de forma declarativa, usando atributos da diretiva @ OutputCache e programáticamente usando as propriedades e métodos da classe HttpCachePolicy.

Pode obter os mesmos resultados configurando a aplicação usando o OutputCacheSettingsSection ou o OutputCacheProfile tipo.

Aplica-se a

Ver também