Export (0) Print
Expand All

HttpWebRequest.DefaultCachePolicy Property

Gets or sets the default cache policy for this request.

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

'Declaration
Public Shared Property DefaultCachePolicy As RequestCachePolicy

Property Value

Type: System.Net.Cache.RequestCachePolicy
A HttpRequestCachePolicy that specifies the cache policy in effect for this request when no other policy is applicable.

Setting this property registers the specified policy for the HTTP and HTTPS schemes. This policy is used for this request if:

There is no WebRequest.CachePolicy property specified for this request.

- or -

The machine and application configuration files do not specify a cache policy that is applicable to the Uniform Resource Identifier (URI) used to create this request.

The cache policy determines whether the requested resource can be taken from a cache instead of sending the request to the resource host computer.

A copy of a resource is only added to the cache if the response stream for the resource is retrieved and read to the end of the stream. So another request for the same resource could use a cached copy, depending on the cache policy level for this request.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft