OutputCacheProfile.Duration Propriedade

Definição

Obtém ou define a duração durante a qual a página ou controlo é armazenada em cache.

public:
 property int Duration { int get(); void set(int value); };
[System.Configuration.ConfigurationProperty("duration", DefaultValue=-1)]
public int Duration { get; set; }
[<System.Configuration.ConfigurationProperty("duration", DefaultValue=-1)>]
member this.Duration : int with get, set
Public Property Duration As Integer

Valor de Propriedade

A duração do tempo em segundos.

Atributos

Exemplos

O seguinte exemplo de código mostra como usar a Duration propriedade.


// Get the current Duration.
Int32 durationValue = 
    outputCacheProfile.Duration;

// Set the Duration property to 0.
outputCacheProfile.Duration = 0;
  ' Get the current Duration.
  Dim durationValue As Int32 = _
  outputCacheProfile.Duration

  ' Set the Duration.
outputCacheProfile.Duration = 0

Observações

Representa Duration o tempo em segundos em que a página ou o controlo do utilizador é armazenado em cache. Definir esta propriedade estabelece uma política de expiração para respostas HTTP da página ou controlo a que se aplica e causará automaticamente a cache da sua saída.

Note

O Duration deve ser definido tanto no perfil como na @ OutputCache diretiva de uma página que utiliza o perfil.

Aplica-se a

Ver também