コード例 #1
0
        // when something is published or unpublished from umbraco, we clear the atoz cache.

        private void ContentService_PublishEvent(IPublishingStrategy sender, PublishEventArgs <IContent> e)
        {
            if (_runtimeCache != null)
            {
                _runtimeCache.ClearCacheByKeySearch("atozpages");
            }
        }
コード例 #2
0
 private void ContentService_Published(Umbraco.Core.Publishing.IPublishingStrategy sender, Umbraco.Core.Events.PublishEventArgs <Umbraco.Core.Models.IContent> e)
 {
     if (blogPostContentTypeId != -1 && e.PublishedEntities.Any(x => x.ContentTypeId == blogPostContentTypeId))
     {
         foreach (var item in e.PublishedEntities)
         {
             cache.ClearCacheByKeySearch("ablog_");
         }
     }
 }
コード例 #3
0
 public void ClearCacheByKeySearch(string keyStartsWith)
 {
     if (_enableCache == false)
     {
         _nullHttpCache.ClearCacheByKeySearch(keyStartsWith);
     }
     else
     {
         _httpCache.ClearCacheByKeySearch(keyStartsWith);
     }
 }
コード例 #4
0
 /// <summary>
 /// Dumps the run time cache.
 /// </summary>
 public void ClearCache()
 {
     _cache.ClearCacheByKeySearch(CacheKeyBase);
 }
コード例 #5
0
 public void Refresh(Guid Id)
 {
     _cache.ClearCacheByKeySearch($"uc_{Id.ToString()}");
     _cache.ClearCacheByKeySearch($"uck_{Id.ToString()}");
     _cache.ClearCacheByKeySearch($"ucpk_{Id.ToString()}");
 }