Condividi tramite


OutputCacheSection.OmitVaryStar Proprietà

Definizione

Ottiene o imposta un valore che indica se l'intestazione vary è attivata.

public:
 property bool OmitVaryStar { bool get(); void set(bool value); };
[System.Configuration.ConfigurationProperty("omitVaryStar", DefaultValue=false)]
public bool OmitVaryStar { get; set; }
[<System.Configuration.ConfigurationProperty("omitVaryStar", DefaultValue=false)>]
member this.OmitVaryStar : bool with get, set
Public Property OmitVaryStar As Boolean

Valore della proprietà

true se l'intestazione vary è attivata. In caso contrario, false. Il valore predefinito è false.

Attributi

Esempio

Nell'esempio di codice riportato di seguito viene illustrato come utilizzare la proprietà OmitVaryStar.


// Get the current OmitVaryStar.
Boolean omitVaryStar =
    outputCacheSection.OmitVaryStar;

// Set the OmitVaryStar.
outputCacheSection.OmitVaryStar = false;
' Get the current OmitVaryStar.
  Dim omitVaryStar As [Boolean] = _
  outputCacheSection.OmitVaryStar

' Set the OmitVaryStar.
outputCacheSection.OmitVaryStar = False

Commenti

L'intestazione vary indica i campi di intestazione richiesta utilizzati dal server per determinare quali risposte memorizzate nella cache vengono inviate in risposta a una richiesta client. Il valore predefinito per la OmitVaryStar proprietà è false. Per impostazione predefinita, ASP.NET invia l'intestazione vary in tutte le POST richieste, nonché in tutte le stringhe di query GET-request. OmitVaryStar Se è true, ASP.NET omette l'intestazione vary quando restituisce la risposta per le pagine memorizzate nella cache, purché la GET richiesta a una risposta venga memorizzata nella cache senza VaryByCustom proprietà e la POST richiesta a una risposta venga memorizzata nella cache senza VaryByParam proprietà e nessuna VaryByCustom proprietà.

Si applica a

Vedi anche