HttpRequestCacheLevel 列挙体
アセンブリ: System (system.dll 内)
構文Public Enumeration HttpRequestCacheLevel
メンバ
解説
使用例アプリケーション ドメインのキャッシュ ポリシーを Default に設定するコード例を次に示します。
// 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; }
プラットフォーム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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
バージョン情報
参照- HttpRequestCacheLevel 列挙体のページへのリンク