HttpResponse.Cache Property
.NET Framework 3.0
Gets the caching policy (expiration time, privacy, vary clauses) of a Web page.
Namespace: System.Web
Assembly: System.Web (in system.web.dll)
Assembly: System.Web (in system.web.dll)
/** @property */ public HttpCachePolicy get_Cache ()
public function get Cache () : HttpCachePolicy
Not applicable.
Property Value
An HttpCachePolicy object containing information about the caching policy of the current response.The following example writes properties of the current cache policy to the HTTP output stream.
get_Response().get_Cache().SetExpires(DateTime.get_Now().
AddSeconds(60));
get_Response().get_Cache().SetCacheability(HttpCacheability.Public);
get_Response().get_Cache().SetValidUntilExpires(false);
get_Response().get_Cache().get_VaryByParams().
set_Item("Category", true);
if (get_Response().get_Cache().get_VaryByParams().
get_Item("Category")) {
//...
}
Response.Cache.SetExpires(DateTime.Now.AddSeconds(60)) Response.Cache.SetCacheability(HttpCacheability.Public) Response.Cache.SetValidUntilExpires(false) Response.Cache.VaryByParams("Category") = true if(Response.Cache.VaryByParams("Category")){ //... }
Community Additions
ADD
Show: