Computer Magic Logo
cache Tag Helper

Wednesday, March 22, 2017

Published by Aristotelis Pitaridis

The cache tag helper allows us to cache part of our view to improve the performance of our web site. The following example demonstrates how to cache the current date and time for 1 minute.

<cache expires-after="@TimeSpan.FromSeconds(60)">
    @DateTime.Now
</cache>