当前位置: 代码迷 >> ASP >> 怎么让页面可以自动缓存
  详细解决方案

怎么让页面可以自动缓存

热度:59   发布时间:2013-01-20 10:22:40.0
如何让页面可以自动缓存?
Response.Buffer = True 
Response.ExpiresAbsolute = Now() - 1 
Response.Expires = 0 
Response.CacheControl = "no-cache" 
Response.AddHeader "Pragma", "No-Cache"

网上找这个代码,说是清除缓存的。。。但是我是要它保存缓存,得如何写?
要保存,不是要清除的

------解决方案--------------------
ExpiresAbsolute 属性指定缓存于浏览器中的页的到期日期和时间
Response.ExpiresAbsolute = Now() - 1 //因为Now() - 1是已经过去的时间,所以表示禁止缓存。
Response.ExpiresAbsolute = Now() + 1 //或者删除这句就要以实现缓存
  相关解决方案