SystemWebCachingSectionGroup.OutputCacheSettings プロパティ
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
構成に含まれる outputCacheSettings セクションを取得します。
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
プロパティ値
OutputCacheSettingsSection オブジェクトです。
- 属性
例
次のコード例は、既存の Web アプリケーションの構成ファイルから OutputCacheSettingsSection オブジェクトを取得する方法を示しています。
// 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)
注釈
OutputCacheSettingsSection オブジェクトは、構成ファイルの outputCacheSettings セクションを参照します。
出力キャッシュの設定では、ディスク ベースの永続出力キャッシュを有効または無効にし、キャッシュするデータを保持する場所を定義し、アプリケーションごとのキャッシュの最大サイズを指定します。
ASP.NET では、@ OutputCache ディレクティブの属性を使用し、HttpCachePolicy クラスのプロパティとメソッドを使用して、宣言によって複数のバージョンのページ応答をキャッシュできます。
OutputCacheSettingsSectionまたはOutputCacheProfileの種類を使用してアプリケーションを構成することで、同じ結果を得ることができます。