OutputCacheProfile.Duration Propiedad

Definición

Obtiene o establece el tiempo durante el cual la página o el control se almacena en caché.

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

Int32

Tiempo en segundos.

Atributos

Ejemplos

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


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