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)
The following example writes properties of the current cache policy to the HTTP output stream.
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"]) { //... }
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: