Skip to main content
HttpCacheControl class

Provides control of the local HTTP cache for responses to HTTP requests by methods in the Windows.Web.Http and Windows.Web.Http.Filters namespaces.

Syntax


var httpCacheControl = cacheControl;

public sealed class HttpCacheControl

Public NotInheritable Class HttpCacheControl

public ref class HttpCacheControl sealed 

Members

The HttpCacheControl class has these types of members:

Methods

The HttpCacheControl class inherits methods from the Object class (C#/VB/C++).

Properties

The HttpCacheControl class has these properties.

PropertyAccess typeDescription

ReadBehavior

Read/write

Get or set the read behavior to use for cache control on the HttpCacheControl object.

WriteBehavior

Read/write

Get or set the write behavior to use for cache control on the HttpCacheControl object.

 

Remarks

The HttpCacheControl object provides properties to get or set the read and write cache control behavior to be used on the HttpBaseProtocolFilter object. HTTP read requests can use the local HTTP cache for the responses. Content returned by HTTP requests can be written to the local HTTP cache.

The HttpCacheControl object allows a developer to set simple read and write cache control behavior on the HttpBaseProtocolFilter object. To use this feature, an app creates an HttpClient object with a new HttpBaseProtocolFilter object. The CacheControl property on the HttpBaseProtocolFilter object returns an HttpCacheControl object used to set read and write cache behavior for the HttpBaseProtocolFilter and the associated HttpClient object. This determines the read and write cache behavior on responses to HttpClient requests.

Developers can still use the HTTP Cache-Control header for more complete control over caching. The HttpCacheDirectiveHeaderValueCollection provides a collection container for instances of the cache directives in Cache-Control HTTP header on HTTP content associated with an HTTP request or response.

Requirements (Windows 10 device family)

Device family

Universal, introduced version 10.0.10240.0

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

Windows.Web.Http.Filters
Windows::Web::Http::Filters [C++]

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8.1 [Windows Store apps, desktop apps]

Minimum supported server

Windows Server 2012 R2 [Windows Store apps, desktop apps]

Minimum supported phone

Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]

Namespace

Windows.Web.Http.Filters
Windows::Web::Http::Filters [C++]

Metadata

Windows.winmd

Attributes

[ DualApiPartition()]
[ MarshalingBehavior(Agile)]
[ Threading(Both)]
[ Version(0x06030000)]

See also

CacheControl
HttpCacheDirectiveHeaderValueCollection
HttpBaseProtocolFilter
HttpClient
Object