Compartir vía


OutputCacheProfile.Duration Propiedad

Definición

Obtiene o establece la duración del tiempo durante el que se almacena en caché la página o el control.

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 propiedad

Duración del tiempo en segundos.

Atributos

Ejemplos

En el ejemplo de código siguiente se muestra cómo usar la Duration propiedad .


// 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

Comentarios

Duration representa el tiempo en segundos en que se almacena en caché la página o el control de usuario. Al establecer esta propiedad se establece una directiva de expiración para las respuestas HTTP de la página o el control al que se aplica y se producirá automáticamente el almacenamiento en caché de su salida.

Nota:

Duration debe definirse en el perfil o en la @ OutputCache directiva de una página mediante el perfil.

Se aplica a

Consulte también