title: How to check when an item in MemoryCache will expire?
body: <p>Is it possible to read the expiration time of an item in MemoryCache?</p>
  
  <p>I'm using the .NET <code>System.Runtime.Caching.MemoryCache</code> to store my configuration information for 30 min before I reload it from the database. As part of a status page I would like to show how old a specific cache item is or when it will expire.</p>
  
  <pre><code>object config = LoadSomeStuffFromDatabase();
  CacheItemPolicy cachePolicy = new CacheItemPolicy() { AbsoluteExpiration = DateTime.Now.AddMinutes(30) }; 
  Cache.Add("MyConfigKey", config, cachePolicy);
  
  // And now I want to do something like this :-)
  DateTime dt = Cache.SomeMagicMethod("MyConfigKey");
  </code></pre>
  
  <p>Today I'm using a variable that is updated every time I reload the configuration. But it would be much nicer to read this information from the cache itself.</p>