title: Is their any drawback calling WCF service inside CacheItemupdateCallback?
body: <p>Is their any drawback having a logic inside CacheItemUpdateCallback specially I'm calling WCF service inside it? </p>
  
  <p>I want my application to lookup in the cache and let the update call back do the job to update my expensive cache item. Is this a good approach?</p>
  
  <p>This is my sample code :</p>
  
  <pre><code>public class CacheItemRepository : ICacheItemRepository
  {
      private readonly IItemService _service;
      private readonly ICacheManager _cacheManager;
      private static string CacheItemKey = "_itemkey_";
  
      public CacheItemRepository(IItemService service, ICacheManager cacheManager)
      {
          _service = service;
          _cacheManager = cacheManager;
      }
  
      public IList&lt;Item&gt; GetAllItem()
      {
          IList&lt;Item&gt; item = null;
  
          if (_cacheManager.TryGet(CacheItemKey, out item))
              return item;
  
          item = _service.GetAllItem();
  
          // Assumming I have CachePolicy here that expire every 15 secs.
          _cacheManager.Add(CacheItemKey, item, CachePolicy, CacheItemUpdateCallback );
  
          return item;
      }
  
  
      private void CacheItemUpdateCallback(string key, object value, CacheItemRemovedReason removedReason)
      {
          var itemList = value as IList&lt;Item&gt;;
  
          var items = _service.GetAllItem(); // Assume this return IList&lt;Item&gt;
  
          // Compare itemlist to items and if the two is not the same 
          // Assuming I have comparer here
  
          // Remove old cache
          _cacheManager.Remove(CacheItemKey);            
  
          // And add new one and assumming I have CachePolicy here that expire every 15 secs.            
          _cacheManager.Add(CacheItemKey, item, CachePolicy, CacheItemUpdateCallback ); 
      }
  }
  </code></pre>