Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
Previous Versions
.NET Framework 1.1
.NET Framework
Reference
System.Web
Methods

  Switch on low bandwidth view
This page is specific to
Microsoft Visual Studio 2003/.NET Framework 1.1

Other versions are also available for the following:
.NET Framework Class Library
HttpCachePolicy.SetCacheability Method

Sets the Cache-Control HTTP header. The Cache-Control HTTP header controls how documents are to be cached on the network.

Overload List

Sets the Cache-Control header to one of the values of HttpCacheability.

[Visual Basic] Overloads Public Sub SetCacheability(HttpCacheability)
[C#] public void SetCacheability(HttpCacheability);
[C++] public: void SetCacheability(HttpCacheability);
[JScript] public function SetCacheability(HttpCacheability);

Sets the Cache-Control header to one of the values of HttpCacheability and appends an extension to the directive.

[Visual Basic] Overloads Public Sub SetCacheability(HttpCacheability, String)
[C#] public void SetCacheability(HttpCacheability, string);
[C++] public: void SetCacheability(HttpCacheability, String*);
[JScript] public function SetCacheability(HttpCacheability, String);

Example

The following example sets the Cache-Control header to the enumeration value private and adds a cache-control extension. The modified directive means that in addition to any non shared cache, any cache shared only by members of the community named "DEV" may cache the response.

[Visual Basic] 
Response.Cache.SetCacheability(HttpCacheability.Private, "Community=DEV")
 

[C#] 
Response.Cache.SetCacheability(HttpCacheability.Private, "Community=DEV");
 

[C++] 
Response->Cache->SetCacheability(HttpCacheability::Private, S"Community=DEV");
 

[JScript] 
Response.Cache.SetCacheability(HttpCacheability.Private, "Community=DEV")
 

See Also

HttpCachePolicy Class | HttpCachePolicy Members | System.Web Namespace

© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker