SystemWebCachingSectionGroup.OutputCacheSettings Eigenschaft

Definition

Ruft den in der Konfiguration enthaltenen outputCacheSettings-Abschnitt ab.

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

Eigenschaftswert

OutputCacheSettingsSection

Das OutputCacheSettingsSection-Objekt.

Attribute

Beispiele

Das folgende Codebeispiel zeigt, wie Sie das OutputCacheSettingsSection Objekt aus der Konfigurationsdatei einer vorhandenen Webanwendung abrufen.


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

Hinweise

Das OutputCacheSettingsSection-Objekt verweist auf den outputCacheSettings-Abschnitt der Konfigurationsdatei.

Die Ausgabecacheeinstellungen aktivieren oder deaktivieren den datenträgerbasierten persistenten Ausgabecache, definieren den Speicherort für die Aufbewahrung der zu zwischengespeicherten Daten und geben die maximale Größe des Caches pro Anwendung an.

ASP.NET ermöglicht es Ihnen, mehrere Versionen einer Seitenantwort deklarativ mithilfe von Attributen der @ OutputCache Direktive zwischenzuspeichern und die Eigenschaften und Methoden der HttpCachePolicy Klasse programmgesteuert zu verwenden.

Sie können dieselben Ergebnisse erzielen, indem Sie die Anwendung mithilfe des OutputCacheSettingsSection Typs oder des OutputCacheProfile Typs konfigurieren.

Gilt für

Siehe auch