Partilhar via


SystemWebCachingSectionGroup.OutputCacheSettings Propriedade

Definição

Obtém a seção outputCacheSettings 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 da propriedade

OutputCacheSettingsSection

O objeto OutputCacheSettingsSection.

Atributos

Exemplos

O exemplo de código a seguir mostra como obter o OutputCacheSettingsSection objeto do arquivo de configuração de um aplicativo 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)

Comentários

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

As configurações de cache de saída habilitam ou desabilitam o cache de saída persistente baseado em disco, definem o local para persistir os dados a serem armazenados em cache e especificam o tamanho máximo do cache por aplicativo.

ASP.NET permite armazenar em cache várias versões de uma resposta de página declarativamente usando atributos da @ OutputCache diretiva e usando programaticamente as propriedades e métodos da HttpCachePolicy classe.

Você pode obter os mesmos resultados configurando o aplicativo usando o tipo ou o OutputCacheSettingsSection OutputCacheProfile tipo.

Aplica-se a

Confira também