System.Web Namespace HttpResponse Class
Sets or gets the caching policy ( expiration time, privacy, vary clauses ) of a Web page.
[ VB ]
Public ReadOnly Property Cache As HttpCachePolicy
[ C# ]
public HttpCachePolicy Cache {get;}
[ C++ ]
public: __property HttpCachePolicy* get_Cache ( );
[ JScript ]
public function get Cache ( ) : HttpCachePolicy;
An HttpCachePolicy object containing information about the caching policy of the current response.
The following example sets properties of the current cache policy as the HTTP response is written to the output stream.
Response.Cache.SetExpires ( DateTime.Now.AddSeconds ( 60 ) );
Response.Cache.SetCacheability ( HttpCacheability.Public );
Response.Cache.SetValidUntilExpires ( false );
Response.Cache.SetExpires ( DateTime.Now.AddSeconds ( 60 ) )
Response.Cache.SetCacheability ( HttpCacheability.Public )
Response.Cache.SetValidUntilExpires ( False ) |
|
C# |
VB |
HttpResponse Members HttpCachePolicy Class ASP.NET Caching Features