HttpCachePolicy.SetVaryByCustom(String) Metodo

Definizione

Specifica una stringa di testo personalizzata in base alla quale 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 in base alla quale variare l'output memorizzato nella cache.

Eccezioni

custom è null.

Il metodo SetVaryByCustom(String) è 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 nella .NET Framework versione 3.5. Per altre informazioni, vedere Versioni e dipendenze.

Si applica a