title: MemoryCache Aspnet MVC
body: <p>i've a problem for implement a MemoryCache object in aspnet.
  This is my code</p>
  
  <pre><code>        ObjectCache cache = MemoryCache.Default;
          CacheItemPolicy policy = new CacheItemPolicy();
          policy.AbsoluteExpiration = DateTimeOffset.Now.AddSeconds(10.0);
          cache.Add("keyName", resultQuery, policy);
  </code></pre>
  
  <p>The object is correct insert in the cache but when i delete and rewrite it the new object in the view is visible only in my session.</p>
  
  <pre><code>        var q = queryObject;
          var cacheKey = "keyName";
          MemoryCache.Default.Remove(cacheKey);
          ObjectCache cache = MemoryCache.Default;
          CacheItemPolicy policy = new CacheItemPolicy();
          policy.AbsoluteExpiration = DateTimeOffset.Now.AddSeconds(10.0);
          cache.Add(cacheKey, q, policy);
  </code></pre>
  
  <p>And this is the simple Get Implementation.</p>
  
  <pre><code>        cache.Get(cacheKey);
  </code></pre>
  
  <p>I don't understand why sometimes works in different browser session and sometimes doesn't work.
  Someone can help me?
  Thanks.</p>