HttpCachePolicy.SetVaryByCustom(String) メソッド

定義

キャッシュされた出力応答を変更するカスタム テキスト文字列を指定します。

public:
 void SetVaryByCustom(System::String ^ custom);
public void SetVaryByCustom(string custom);
member this.SetVaryByCustom : string -> unit
Public Sub SetVaryByCustom (custom As String)

パラメーター

custom
String

キャッシュされた出力を変更するテキスト文字列。

例外

customnullです。

SetVaryByCustom(String) メソッドは既に呼び出されています。

次のコード例では、カスタム vary 文字列を "Accept-Charset" に設定する方法を示します。これにより、配信元サーバーのキャッシュは、ブラウザーの Accept-Charset ヘッダーに応じて、キャッシュされた複数の応答のいずれかを選択します。

Response.Cache.SetVaryByCustom("Accept-Charset");
Response.Cache.SetVaryByCustom("Accept-Charset")

注釈

SetVaryByCustom は、.NET Framework バージョン 3.5 で導入されています。 詳細については、「 バージョンと依存関係」を参照してください。

適用対象