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));
}
}
这是一个依赖缓存,如何判断依赖缓存的失效。
慕容708150
手掌心