title: .NET Caching how does Sliding Expiration work?
body: <p>If I use an ObjectCache and add an item like so:</p>
  <pre><code>ObjectCache cache = MemoryCache.Default;
  string o = &quot;mydata&quot;;
  cache.Add(&quot;mykey&quot;, o, DateTime.Now.AddDays(1));
  </code></pre>
  <p>I understand the object will expire in 1 day. But if the object is accessed 1/2 a day later using:</p>
  <pre><code>object mystuff = cache[&quot;mykey&quot;];
  </code></pre>
  <p>Does this reset the timer so it's now 1 day since the last access of the entry with the key &quot;mykey&quot;, or it still 1/2 a day until expiry?</p>
  <p>If the answer is no is there is a way to do this I would love to know.</p>
  <p>Thanks.</p>