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


VaryByParams プロパティは、リソースに対してキャッシュされている応答が複数ある場合に、ASP.NET で HTTP Get パラメータまたは Post パラメータのどちらを使用して応答を一意に識別するかを示します。これは、応答がヘッダーやパラメータなどのクライアント入力に依存している場合に便利です。
HttpCacheVaryByParams は HTTP キャッシュ コントロール ヘッダーと直接の関係はありませんが、クライアントまたはプロキシが指定したパラメータで識別できることを保証するのに役立ちます。VaryByParams の詳細については、W3C (World Wide Web Consortium) Web のサイトで『RFC 2616: Hypertext Transfer Protocol -- HTTP/1.1』を参照してください。詳細については、第 14 項「Header Field Definitions」を参照してください。

HttpCacheVaryByParams オブジェクトに、HttpResponse に関連付けられている HttpCachePolicy オブジェクトからアクセスする方法を次のコード例に示します。
Response.Cache.SetExpires(DateTime.Now.AddSeconds(60)) Response.Cache.SetCacheability(HttpCacheability.Public) Response.Cache.SetValidUntilExpires(False) Response.Cache.VaryByParams("Category") = True If Response.Cache.VaryByParams("Category") Then '... End If
Response.Cache.SetExpires(DateTime.Now.AddSeconds(60)); Response.Cache.SetCacheability(HttpCacheability.Public); Response.Cache.SetValidUntilExpires(false); Response.Cache.VaryByParams["Category"] = true; if (Response.Cache.VaryByParams["Category"]) { //... }
get_Response().get_Cache().SetExpires(DateTime.get_Now(). AddSeconds(60)); get_Response().get_Cache().SetCacheability(HttpCacheability.Public); get_Response().get_Cache().SetValidUntilExpires(false); get_Response().get_Cache().get_VaryByParams(). set_Item("Category", true); if (get_Response().get_Cache().get_VaryByParams(). get_Item("Category")) { //... }


System.Web.HttpCacheVaryByParams


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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


- HttpCacheVaryByParams クラスのページへのリンク