
364
|
Chapter 17: The HttpResponse Class
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
Expires
Integer = Response.Expires
Response.Expires = Integer
Returns or sets an integer representing the number of minutes before a cached
page expires. This property is used in concert with the CacheControl property to
control caching of responses.
Parameter
Integer
An Integer variable to receive or set the expiration in minutes.
Notes
This property is provided for backward compatibility with classic ASP. It has been
deprecated in favor of the methods of the HttpCachePolicy instance returned by
the Cache property.
ExpiresAbsolute
DateTime = Response.Expires
Response.Expires = DateTime
Returns or sets a DateTime value representing the date and time at which a
cached response should expire.
Parameter
DateTime
A DateTime variable to receive or set the absolute expiration.
Example
The following example makes the current response cacheable by using the Cache-
Control property and then sets the absolute expiration to 30 seconds from the
current time:
Sub Page_Load( )
Response.CacheControl = "Public"
Response.ExpiresAbsolute = DateTime.Now.AddSeconds(30)
Message.Text = Now.ToString( )
End Sub
Notes
This property is provided for backward compatibility with classic ASP. It has been
deprecated in favor of the methods of the HttpCachePolicy instance returned by
the Cache ...