HttpRequestCachePolicy クラス
アセンブリ: System (system.dll 内)
構文
解説DefaultCachePolicy プロパティ、アプリケーション構成ファイル、またはコンピュータの構成ファイルを使用して、アプリケーションの既定のキャッシュ ポリシーを指定できます。詳細については、「requestCaching 要素 (ネットワーク設定)」を参照してください。
使用例アプリケーション ドメインの既定のキャッシュ ポリシーを作成し、ある要求について、そのポリシーをオーバーライドするコード例を次に示します。
// The following method demonstrates overriding the // caching policy for a request. public static WebResponse GetResponseNoCache(Uri uri) { // Set a default policy level for the "http:" and "https" schemes. HttpRequestCachePolicy policy = new HttpRequestCachePolicy(HttpRequestCacheLevel.Default); HttpWebRequest.DefaultCachePolicy = policy; // Create the request. WebRequest request = WebRequest.Create(uri); // Define a cache policy for this request only. HttpRequestCachePolicy noCachePolicy = new HttpRequestCachePolicy(HttpRequestCacheLevel.NoCacheNoStore); request.CachePolicy = noCachePolicy; WebResponse response = request.GetResponse(); Console.WriteLine("IsFromCache? {0}", response.IsFromCache); return response; }
継承階層System.Net.Cache.RequestCachePolicy
System.Net.Cache.HttpRequestCachePolicy
スレッド セーフ
プラットフォームWindows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
バージョン情報
参照Weblioに収録されているすべての辞書からHttpRequestCachePolicy クラスを検索する場合は、下記のリンクをクリックしてください。
全ての辞書からHttpRequestCachePolicy クラス
を検索
- HttpRequestCachePolicy クラスのページへのリンク