Lar*_*nal 11 asp.net caching web-config
如果我有以下行,我什么时候应该期望缓存过期?
System.Web.HttpRuntime.Cache.Insert("someKey", "Test value");
Run Code Online (Sandbox Code Playgroud)
这将插入没有显式到期集的对象.这意味着该对象不会自动从缓存中删除,除非运行时由于内存使用率过高而决定从缓存中删除内容.
调用此重载与调用相同
Cache.Insert(
key, value,
null, /*CacheDependency*/
NoAbsoluteExpiration, /*absoluteExpiration*/
NoSlidingExpiration, /*slidingExpiratioin*/
CacheItemPriority.Normal, /*priority*/
null /*onRemoveCallback*/
);
Run Code Online (Sandbox Code Playgroud)
顺便说一句:您可以使用.NET反射器来找出这些东西.