HttpRequestCachePolicy Constructor (HttpCacheAgeControl, TimeSpan)
.NET Framework (current version)
Initializes a new instance of the HttpRequestCachePolicy class using the specified age control and time values.
Assembly: System (in System.dll)
public:
HttpRequestCachePolicy(
HttpCacheAgeControl cacheAgeControl,
TimeSpan ageOrFreshOrStale
)
Parameters
- cacheAgeControl
-
Type:
System.Net.Cache::HttpCacheAgeControl
One of the following HttpCacheAgeControl enumeration values: MaxAge, MaxStale, or MinFresh.
- ageOrFreshOrStale
-
Type:
System::TimeSpan
A TimeSpan value that specifies an amount of time. See the Remarks section for more information.
| Exception | Condition |
|---|---|
| ArgumentException | The value specified for the cacheAgeControl parameter cannot be used with this constructor. |
The following code example demonstrates creating a cache policy based on minimum freshness.
.NET Framework
Available since 2.0
Available since 2.0
Show: