This documentation is archived and is not being maintained.

HttpRequestCachePolicy.MaxStale Property

Gets the maximum staleness value that is permitted for a resource returned from the cache.

Namespace: System.Net.Cache
Assembly: System (in system.dll)

public TimeSpan MaxStale { get; }
/** @property */
public TimeSpan get_MaxStale ()

public function get MaxStale () : TimeSpan

Not applicable.

Property Value

A TimeSpan value that is set to the maximum staleness value specified when this instance was created. If no date was specified, this property's value is MinValue.

This property specifies the amount of time after content expiration during which the cached copy of the resource is acceptable. The value for this property is specified when the instance is constructed.

The following code example demonstrates displaying the value of this property.

public static HttpRequestCachePolicy CreateMaxStalePolicy(TimeSpan span)
{
    HttpRequestCachePolicy policy = 
        new HttpRequestCachePolicy(HttpCacheAgeControl.MaxStale, span);
       
   Console.WriteLine("Max stale is {0}", policy.MaxStale);
    return policy;
} 

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0
Show: