Share via


CacheTagHelper Class

Definition

TagHelper implementation targeting <cache> elements.

public ref class CacheTagHelper : Microsoft::AspNetCore::Mvc::TagHelpers::CacheTagHelperBase
public class CacheTagHelper : Microsoft.AspNetCore.Mvc.TagHelpers.CacheTagHelperBase
type CacheTagHelper = class
    inherit CacheTagHelperBase
Public Class CacheTagHelper
Inherits CacheTagHelperBase
Inheritance

Constructors

CacheTagHelper(CacheTagHelperMemoryCacheFactory, HtmlEncoder)

Creates a new CacheTagHelper.

CacheTagHelper(CacheTagHelperMemoryCacheFactory, HtmlEncoder)

Creates a new CacheTagHelper.

CacheTagHelper(IMemoryCache, HtmlEncoder)

Creates a new CacheTagHelper.

Fields

CacheKeyPrefix

Prefix used by CacheTagHelper instances when creating entries in MemoryCache.

Properties

Enabled

Gets or sets the value which determines if the tag helper is enabled or not.

(Inherited from CacheTagHelperBase)
ExpiresAfter

Gets or sets the duration, from the time the cache entry was added, when it should be evicted.

(Inherited from CacheTagHelperBase)
ExpiresOn

Gets or sets the exact DateTimeOffset the cache entry should be evicted.

(Inherited from CacheTagHelperBase)
ExpiresSliding

Gets or sets the duration from last access that the cache entry should be evicted.

(Inherited from CacheTagHelperBase)
HtmlEncoder

Gets the HtmlEncoder which encodes the content to be cached.

(Inherited from CacheTagHelperBase)
MemoryCache

Gets the IMemoryCache instance used to cache entries.

Order

When a set of ITagHelpers are executed, their Init(TagHelperContext)'s are first invoked in the specified Order; then their ProcessAsync(TagHelperContext, TagHelperOutput)'s are invoked in the specified Order. Lower values are executed first.

(Inherited from CacheTagHelperBase)
Priority

Gets or sets the CacheItemPriority policy for the cache entry.

VaryBy

Gets or sets a String to vary the cached result by.

(Inherited from CacheTagHelperBase)
VaryByCookie

Gets or sets a comma-delimited set of cookie names to vary the cached result by.

(Inherited from CacheTagHelperBase)
VaryByCulture

Gets or sets a value that determines if the cached result is to be varied by request culture.

Setting this to true would result in the result to be varied by CurrentCulture and CurrentUICulture.

(Inherited from CacheTagHelperBase)
VaryByHeader

Gets or sets a comma-delimited set of HTTP request headers to vary the cached result by.

(Inherited from CacheTagHelperBase)
VaryByQuery

Gets or sets a comma-delimited set of query parameters to vary the cached result by.

(Inherited from CacheTagHelperBase)
VaryByRoute

Gets or sets a comma-delimited set of route data parameters to vary the cached result by.

(Inherited from CacheTagHelperBase)
VaryByUser

Gets or sets a value that determines if the cached result is to be varied by the Identity for the logged in User.

(Inherited from CacheTagHelperBase)
ViewContext

Gets or sets the ViewContext for the current executing View.

(Inherited from CacheTagHelperBase)

Methods

Init(TagHelperContext)

Initializes the ITagHelper with the given context. Additions to Items should be done within this method to ensure they're added prior to executing the children.

(Inherited from TagHelper)
Process(TagHelperContext, TagHelperOutput)

Synchronously executes the TagHelper with the given context and output.

(Inherited from TagHelper)
ProcessAsync(TagHelperContext, TagHelperOutput)

Asynchronously executes the TagHelper with the given context and output.

Applies to