We are adding a new caching tag helper named <distributed-cache>. It differs from the <cache> tag helper by being able to serialize the html fragment in a distributed store like Redis or a database for instance.
For example you can cache the rendering of a View Component like this:
<distributed-cache key="some-key" expires-after="@TimeSpan.FromMinutes(10)">
@Component.Invoke("Some-Component")
</distributed-cache>
The content will be serialized and stored on a distributed cache storage. The default implementation uses the IDistributedCache service but you can override the behavior by providing custom implementations of IDistributedCacheTagHelperFormatter and IDistributedCacheTagHelperService.
Use aspnet/Mvc#3867 for further discussions.
We are adding a new caching tag helper named
<distributed-cache>. It differs from the<cache>tag helper by being able to serialize the html fragment in a distributed store like Redis or a database for instance.For example you can cache the rendering of a View Component like this:
The content will be serialized and stored on a distributed cache storage. The default implementation uses the
IDistributedCacheservice but you can override the behavior by providing custom implementations ofIDistributedCacheTagHelperFormatterandIDistributedCacheTagHelperService.Use aspnet/Mvc#3867 for further discussions.