HttpCachePolicy.SetVaryByCustom(String) Metodo

Definizione

Specifica una stringa di testo personalizzata per variare le risposte di output memorizzate nella cache.

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

Parametri

custom
String

Stringa di testo da cui variare l'output memorizzato nella cache.

Eccezioni

custom è null.

Il SetVaryByCustom(String) metodo è già stato chiamato.

Esempio

Nell'esempio di codice seguente viene illustrato come impostare la stringa personalizzata variabile su "Accept-Charset", che fa sì che la cache del server di origine scelga una delle diverse risposte memorizzate nella cache a seconda dell'intestazione del Accept-Charset browser.

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

Commenti

SetVaryByCustom è stato introdotto in .NET Framework versione 3.5. Per altre informazioni, vedere Versioni e dipendenze.

Si applica a