protected void Page_Load(object sender, EventArgs e) {if (!IsPostBack) {string fileDependencyPath = Server.MapPath("~/TextFile1.txt"); Response.AddFileDependency(fileDependencyPath); Response.Cache.SetExpires(DateTime.Now.AddSeconds(10)); Response.Cache.SetCacheability(HttpCacheability.Public); Response.Cache.SetValidUntilExpires(true); Cache.Insert("test1", DateTime.Now.ToString(), new System.Web.Caching.CacheDependency(fileDependencyPath));}} 这是一个依赖缓存,如何判断依赖缓存的失效。
- 2 回答
- 0 关注
- 294 浏览
添加回答
举报
0/150
提交
取消