Skip to main content
HttpBaseProtocolFilter.CacheControl | cacheControl property

Get or set the read and write cache control behavior to be used on the HttpBaseProtocolFilter object.

Syntax


var cacheControl = httpBaseProtocolFilter.cacheControl;

public HttpCacheControl CacheControl { get; }

Public ReadOnly Property CacheControl As HttpCacheControl

public:
property HttpCacheControl^ CacheControl { 
   HttpCacheControl^ get();
}

Property value

Type: HttpCacheControl

The cache control behavior to be used on the HttpBaseProtocolFilter object.

Remarks

The CacheControl property gets an HttpCacheControl object that allows access to the read and write cache control behavior used by 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 CacheControl property 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 returns an HttpCacheControl object. Properties on the HttpCacheControl object are used to set to the read and write cache control 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. The Cache-Control header lets an app control caching behavior used by a server on HTTP content.

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

Minimum supported server

Windows Server 2012 R2

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

See also

HttpBaseProtocolFilter
HttpCacheControl
HttpCacheDirectiveHeaderValueCollection
HttpClient