Bewerken

Delen via


HttpRequestCachePolicy.CacheSyncDate Property

Definition

Gets the cache synchronization date for this instance.

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

Property Value

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

Examples

The following code example displays the value of this property.

static HttpRequestCachePolicy^ CreateLastSyncPolicy( DateTime when )
{
   HttpRequestCachePolicy^ policy = gcnew HttpRequestCachePolicy( when );
   Console::WriteLine( L"When: {0}", when );
   Console::WriteLine( policy->CacheSyncDate );
   return policy;
}
public static HttpRequestCachePolicy CreateLastSyncPolicy(DateTime when)
{
    HttpRequestCachePolicy policy =
       new HttpRequestCachePolicy(when);

    Console.WriteLine("When: {0}", when);
    Console.WriteLine(policy.CacheSyncDate.ToString());
    return policy;
}

Remarks

The cache synchronization date allows you to specify an absolute date when cached contents must be revalidated. If the cache entry was last revalidated prior to the cache synchronization date, revalidation with the server occurs. If the cache entry was revalidated after the cache synchronization date and there are no server revalidation requirements that make the cached entry invalid, the entry from the cache is used. If the cache synchronization date is set to a future date, the entry is revalidated every time it is requested, until the cache synchronization date passes.

Applies to