OutputCacheProfile クラス
アセンブリ: System.Web (system.web.dll 内)


OutputCacheProfile クラスを使用すると、構成ファイルの caching セクション内の outputCacheProfiles セクションの add 要素にプログラムからアクセスして変更できます。
OutputCacheProfile オブジェクトを使用すると、依存関係、キャッシュ場所、キャッシュの有効期限などの頻繁に使用される構成設定をまとめることができるので、ページごとに指定する必要がなくなります。
OutputCacheProfile は、@ OutputCache ディレクティブの CacheProfile 属性を使用してページに適用できます。
![]() |
---|
@ OutputCache ディレクティブは、OutputCacheProfile オブジェクトに格納されている、Enabled 属性以外のすべての設定をオーバーライドできます。これにより、このオブジェクトをオーバーライドしている可能性のあるすべてのページ内のディレクティブを変更することなく、OutputCacheProfile を有効にしたり無効にしたりできます。 |
CacheDependency クラスは、依存関係を監視し、キャッシュ アイテムが変更されたときに、そのキャッシュ アイテムが自動的に削除されるようにします。

OutputCacheProfiles コレクションを使用して、その OutputCacheProfile オブジェクトにアクセスする方法を次のコード例に示します。
' Get the Web application configuration. Dim webConfig _ As System.Configuration.Configuration = _ WebConfigurationManager.OpenWebConfiguration( _ "/aspnetTest") ' Get the section. Dim configPath As String = _ "system.web/caching/outputCacheSettings" Dim outputCacheSettings _ As System.Web.Configuration.OutputCacheSettingsSection = _ CType(webConfig.GetSection(configPath), _ System.Web.Configuration.OutputCacheSettingsSection) ' Get the profile at zero index. Dim outputCacheProfile _ As System.Web.Configuration.OutputCacheProfile = _ outputCacheSettings.OutputCacheProfiles(0)
// Get the Web application configuration. System.Configuration.Configuration webConfig = WebConfigurationManager.OpenWebConfiguration("/aspnetTest"); // Get the section. string configPath = "system.web/caching/outputCacheSettings"; System.Web.Configuration.OutputCacheSettingsSection outputCacheSettings = (System.Web.Configuration.OutputCacheSettingsSection)webConfig.GetSection( configPath); // Get the profile at zero index. System.Web.Configuration.OutputCacheProfile outputCacheProfile = outputCacheSettings.OutputCacheProfiles[0];

System.Configuration.ConfigurationElement
System.Web.Configuration.OutputCacheProfile


Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


OutputCacheProfile メンバ
System.Web.Configuration 名前空間
OutputCacheProfileCollection
CacheDependency クラス
その他の技術情報
caching 要素 (ASP.NET 設定スキーマ)
caching の outputCacheSettings の outputCacheProfiles 要素 (ASP.NET 設定スキーマ)
@ OutputCache
アプリケーション データのキャッシュ
方法 : ASP.NET ページのキャッシュを宣言によって設定する
方法 : ページのキャッシュをプログラムによって設定する
- OutputCacheProfile クラスのページへのリンク