CacheControl Property

HttpResponse.CacheControl Property

Sets the Cache-Control HTTP header to Public or Private.

Namespace: System.Web
Assembly: System.Web (in system.web.dll)

public string CacheControl { get; set; }
/** @property */
public String get_CacheControl ()

/** @property */
public void set_CacheControl (String value)

public function get CacheControl () : String

public function set CacheControl (value : String)

Property Value

"Public" or "Private".

Exception typeCondition


CacheControl is an invalid cache control value (not Private or Public).

The values for Private and Public are strings and must be enclosed in quotation marks (" ").

The CacheControl, Expires, and ExpiresAbsolute properties have been deprecated in favor of the methods of the HttpCachePolicy class available through the Cache intrinsic object to control the IIS output cache and client caches.

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

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

.NET Framework

Supported in: 2.0, 1.1, 1.0

Community Additions

© 2016 Microsoft