Redigera

Dela via


HttpRequestCachePolicy.MinFresh Property

Definition

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

public:
 property TimeSpan MinFresh { TimeSpan get(); };
public TimeSpan MinFresh { get; }
member this.MinFresh : TimeSpan
Public ReadOnly Property MinFresh As TimeSpan

Property Value

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

Examples

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

static HttpRequestCachePolicy^ CreateMinFreshPolicy( TimeSpan span )
{
   HttpRequestCachePolicy^ policy = gcnew HttpRequestCachePolicy( HttpCacheAgeControl::MinFresh,span );
   Console::WriteLine( L"Minimum freshness {0}", policy->MinFresh );
   return policy;
}
public static HttpRequestCachePolicy CreateMinFreshPolicy(TimeSpan span)
{
    HttpRequestCachePolicy policy =
        new HttpRequestCachePolicy(HttpCacheAgeControl.MinFresh, span);
    Console.WriteLine("Minimum freshness {0}", policy.MinFresh.ToString());
    return policy;
}

Remarks

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.

Applies to