// It will invalidate the memory cache and all the dynamic caches which have been tagged.
        public async Task InvalidateCachedDateTimeAsync()
        {
            // As mentioned ISignal service is used to invalidate the memory cache.
            _signal.SignalToken(MemoryCacheKey);

            // ITagCache.RemoveTagAsync will invalidate all the dynamic caches which are tagged with the given tag.
            await _tagCache.RemoveTagAsync(DynamicCacheTag);
        }
Beispiel #2
0
 public override Task PublishedAsync(PublishContentContext context, AliasPart instance)
 {
     return(_tagCache.RemoveTagAsync($"alias:{instance.Alias}"));
 }
 public override Task PublishedAsync(PublishContentContext context)
 {
     return(_tagCache.RemoveTagAsync($"contentitemid:{context.ContentItem.ContentItemId}"));
 }
Beispiel #4
0
 private Task RemoveTagAsync(AutoroutePart part)
 {
     return(_tagCache.RemoveTagAsync($"alias:{part.Path}"));
 }
        public async Task <ActionResult> Tag(string tag)
        {
            await _tagCache.RemoveTagAsync(tag);

            return(RedirectToAction("Tag", "Home", new { area = "OrchardCore.Demo" }));
        }