cache.Insert("test", content, null, Cache.NoAbsoluteExpiration, TimeSpan.FromMinutes(2));
我设置2分钟失效。但是在这2分钟里,我刷新1次页面,catch中的test就不丢失,以后每1分钟刷新1次,直到10分钟,
test还是不丢失。我像实现不管页面刷不刷新,2分钟后失效该怎么办?
我设置2分钟失效。但是在这2分钟里,我刷新1次页面,catch中的test就不丢失,以后每1分钟刷新1次,直到10分钟,
test还是不丢失。我像实现不管页面刷不刷新,2分钟后失效该怎么办?
if (content == null)
{
content = datatime.now.tostring(); cache.Insert("test", content, null, Cache.NoAbsoluteExpiration, TimeSpan.FromMinutes(2));
}
if(Cache["test"]==null)