SystemWebCachingSectionGroup.OutputCacheSettings Eigenschaft
Definition
Wichtig
Einige Informationen beziehen sich auf Vorabversionen, die vor dem Release ggf. grundlegend überarbeitet werden. Microsoft übernimmt hinsichtlich der hier bereitgestellten Informationen keine Gewährleistungen, seien sie ausdrücklich oder konkludent.
Ruft den outputCacheSettings Abschnitt in der Konfiguration 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
Das OutputCacheSettingsSection-Objekt.
- Attribute
Beispiele
Das folgende Codebeispiel zeigt, wie Das OutputCacheSettingsSection Objekt aus der Konfigurationsdatei einer vorhandenen Webanwendung abgerufen wird.
// 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 bezieht sich auf den outputCacheSettings Abschnitt der Konfigurationsdatei.
Die Ausgabecacheeinstellungen aktivieren oder deaktivieren den datenträgerbasierten beständigen Ausgabecache, definieren den Speicherort für das Speichern der zu zwischengespeicherten Daten und geben die maximale Größe des Caches pro Anwendung an.
mit ASP.NET können Sie mehrere Versionen einer Seitenantwort deklarativ zwischenspeichern, indem Sie Attribute der @ OutputCache-Direktive verwenden und die Eigenschaften und Methoden der klasse HttpCachePolicy programmgesteuert verwenden.
Sie können dieselben Ergebnisse erzielen, indem Sie die Anwendung mit dem OutputCacheSettingsSection Typ oder dem OutputCacheProfile Typ konfigurieren.