SystemWebCachingSectionGroup.OutputCacheSettings Proprietà

Definizione

Ottiene la outputCacheSettings sezione contenuta nella configurazione.

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

Valore della proprietà

Oggetto OutputCacheSettingsSection.

Attributi

Esempio

Nell'esempio di codice seguente viene illustrato come ottenere l'oggetto OutputCacheSettingsSection dal file di configurazione di un'applicazione Web esistente.


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

Commenti

L'oggetto OutputCacheSettingsSection fa riferimento alla outputCacheSettings sezione del file di configurazione.

Le impostazioni della cache di output abilitano o disabilitano la cache di output permanente basata su disco, definiscono il percorso per rendere persistenti i dati da memorizzare nella cache e specificano le dimensioni massime della cache per applicazione.

ASP.NET consente di memorizzare nella cache più versioni di una risposta di pagina in modo dichiarativo usando gli attributi della direttiva e a livello di codice usando le proprietà e i metodi della classe />

È possibile ottenere gli stessi risultati configurando l'applicazione usando o OutputCacheSettingsSection il OutputCacheProfile tipo .

Si applica a

Vedi anche