HttpRequestCachePolicy.MinFresh Property


Gets the minimum freshness that is permitted for a resource returned from the cache.

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

public TimeSpan MinFresh { get; }

Property Value

Type: System.TimeSpan

A TimeSpan value that specifies the minimum freshness specified when this instance was created. If no date was specified, this property's value is MinValue.

This value specifies the amount of time before 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 CreateMinFreshPolicy(TimeSpan span)
    HttpRequestCachePolicy policy = 
        new HttpRequestCachePolicy(HttpCacheAgeControl.MinFresh, span); 
    Console.WriteLine("Minimum freshness {0}", policy.MinFresh.ToString());
    return policy;

.NET Framework
Available since 2.0
Return to top