Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
SlidingExpirationDache 中 AddOrUpdate 方法中的时间跨度到底是什么? 使用更好SlidingExpiration还是AbsoluteExpiration, 我的意思是有什么区别?
SlidingExpiration
AbsoluteExpiration
滑动过期意味着它是对象未被触摸的时间段,然后它将从缓存中删除。这基本上意味着只要有人访问对象,计时器就会被重置。
绝对过期意味着它是在对象将被删除之前的绝对时间段,无论使用情况如何。因此,一旦达到绝对时间,对象将被标记为移除。
什么更好取决于您的数据及其使用情况和您的缓存策略