// 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"); } }
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_"); } } }
public void ClearCacheByKeySearch(string keyStartsWith) { if (_enableCache == false) { _nullHttpCache.ClearCacheByKeySearch(keyStartsWith); } else { _httpCache.ClearCacheByKeySearch(keyStartsWith); } }
/// <summary> /// Dumps the run time cache. /// </summary> public void ClearCache() { _cache.ClearCacheByKeySearch(CacheKeyBase); }
public void Refresh(Guid Id) { _cache.ClearCacheByKeySearch($"uc_{Id.ToString()}"); _cache.ClearCacheByKeySearch($"uck_{Id.ToString()}"); _cache.ClearCacheByKeySearch($"ucpk_{Id.ToString()}"); }