CacheControl Property

HttpResponse.CacheControl Property

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

[Visual Basic]
Public Property CacheControl As String
public string CacheControl {get; set;}
public: __property String* get_CacheControl();
public: __property void set_CacheControl(String*);
public function get CacheControl() : String;
public function set CacheControl(String);

Property Value

"Public" or "Private".


Exception Type Condition
ArgumentException 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.


Platforms: Windows 2000, Windows XP Professional, Windows Server 2003 family

See Also

HttpResponse Class | HttpResponse Members | System.Web Namespace

© 2016 Microsoft