Dim ds As DataSet 'Put the ds into Cache ds = CType(Cache("index"), DataSet) If ds Is Nothing Then ds = New DataSet() Cache.Insert("index", ds, Nothing, DateTime.Now.AddDays(1), TimeSpan.Zero) End If'a example for cache 'Merry X`mas & Happy New Year !
Merrychristmas,and happy new year!
正在准备使用,Mark,同时共祝大家圣诞快乐!
看看SqlServer帮助: decimal[(p[, s])] p(精度) 指定小数点左边和右边可以存储的十进制数字的最大个数。精度必须是从 1 到最大精度之间的值。最大精度为 38。 s(小数位数) 指定小数点右边可以存储的十进制数字的最大个数。小数位数必须是从 0 到 p 之间的值。默认小数位数是 0,因而 0 <= s <= p。最大存储大小基于精度而变化。祝节日快乐!!
'Put the ds into Cache
ds = CType(Cache("index"), DataSet)
If ds Is Nothing Then
ds = New DataSet()
Cache.Insert("index", ds, Nothing, DateTime.Now.AddDays(1), TimeSpan.Zero)
End If'a example for cache
'Merry X`mas & Happy New Year !
decimal[(p[, s])]
p(精度)
指定小数点左边和右边可以存储的十进制数字的最大个数。精度必须是从 1 到最大精度之间的值。最大精度为 38。
s(小数位数)
指定小数点右边可以存储的十进制数字的最大个数。小数位数必须是从 0 到 p 之间的值。默认小数位数是 0,因而 0 <= s <= p。最大存储大小基于精度而变化。祝节日快乐!!
Response.Cache.SetExpires(DateTime.Now.AddSeconds(60));
Response.Cache.SetCacheability(HttpCacheability.Public);
Response.Cache.SetExpires(DateTime.Now.AddSeconds(60))
Response.Cache.SetCacheability(HttpCacheability.Public)
Response.Cache.SetExpires(DateTime.Now.AddSeconds(60));
Response.Cache.SetCacheability(HttpCacheability.Public);
若要使之成为变化的过期策略(即每次请求页时都重新设置过期时间),请按以下代码所示来设置 SlidingExpiration 属性。
Response.Cache.SetExpires(DateTime.Now.AddSeconds(60));
Response.Cache.SetCacheability(HttpCacheability.Public);
Response.Cache.SetSlidingExpiration(true);
Response.Cache.SetExpires(DateTime.Now.AddSeconds(60))
Response.Cache.SetCacheability(HttpCacheability.Public)
Response.Cache.SetSlidingExpiration(True)
Response.Cache.SetExpires(DateTime.Now.AddSeconds(60));
Response.Cache.SetCacheability(HttpCacheability.Public);
Response.Cache.SetSlidingExpiration(true);
注意:启用变化的过期后 (SetSlidingExpiration(true)),对原服务器的请求总是会生成一个响应。在下游缓存可满足客户端请求(缓存中的内容尚未过期)而无须从原服务器请求内容的情况下,使用变化的过期时间是很有用的。 -----------------------------------------------------------------------------------------------------------------------------------------------------
从 ASP 移植过来的应用程序可能已用 ASP 属性设置了缓存策略;例如:
Response.CacheControl = "Public";
Response.Expires = 60;
Response.CacheControl = "Public"
Response.Expires = 60
Response.CacheControl = "Public";
Response.Expires = 60;