Udostępnij za pośrednictwem


SystemWebCachingSectionGroup.OutputCacheSettings Właściwość

Definicja

Pobiera sekcję outputCacheSettings zawartą w konfiguracji.

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

Wartość właściwości

OutputCacheSettingsSection

Obiekt OutputCacheSettingsSection.

Atrybuty

Przykłady

Poniższy przykład kodu pokazuje, jak uzyskać OutputCacheSettingsSection obiekt z pliku konfiguracji istniejącej aplikacji internetowej.


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

Uwagi

Obiekt OutputCacheSettingsSection odwołuje się do outputCacheSettings sekcji pliku konfiguracji.

Ustawienia wyjściowej pamięci podręcznej włączają lub wyłączają pamięć podręczną danych wyjściowych opartych na dysku, definiują lokalizację utrwalania danych do buforowania i określają maksymalny rozmiar pamięci podręcznej na aplikację.

ASP.NET umożliwia deklaratywne buforowanie wielu wersji odpowiedzi strony przy użyciu atrybutów @ OutputCache dyrektywy i programowo przy użyciu właściwości i metod HttpCachePolicy klasy.

Te same wyniki można osiągnąć, konfigurując aplikację przy użyciu OutputCacheSettingsSection typu lub OutputCacheProfile .

Dotyczy

Zobacz też