MVCCaching.Base.Core.Components 8.0.0

dotnet add package MVCCaching.Base.Core.Components --version 8.0.0                
NuGet\Install-Package MVCCaching.Base.Core.Components -Version 8.0.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="MVCCaching.Base.Core.Components" Version="8.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add MVCCaching.Base.Core.Components --version 8.0.0                
#r "nuget: MVCCaching.Base.Core.Components, 8.0.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install MVCCaching.Base.Core.Components as a Cake Addin
#addin nuget:?package=MVCCaching.Base.Core.Components&version=8.0.0

// Install MVCCaching.Base.Core.Components as a Cake Tool
#tool nuget:?package=MVCCaching.Base.Core.Components&version=8.0.0                

MVCCaching Base and Components

This readme is specifically for the Platform Agnostic MVCCaching packages. If you are using this for Xperience by Kentico, or Kentico Xperience 13, please see those specific readmes.

Concept

I believe caching should be a common optimization practice. Caching, at it's core, consists of these core elements:

  1. What to cache (the object)
  2. What is that cached call's unique identifier (it's Name)
  3. How long should something be cached (it's Duration)
  4. What triggers should clear the cache prematurely (it's Dependencies)

Along with that, there may be things that caches often need to know:

  1. Language
  2. If caching should be disabled (IE Preview mode)

Lastly, in terms of usage of the <cache> tag within ASP.Net Core MVC, you also often need:

  1. Cache Dependencies for the <cache> tag
  2. Cache Scope (to determine the dependencies called within the scope that should pass to the cache tag's dependencies)
  3. Cache Store (a way to store dependencies as they are generated)

The Tool

MVCCaching.Base.Core Provides interfaces, extension methods and helpers to accomplish these concepts. These do not, however, actually implement them, as that varies.

MVCCaching.Base.Core.Components also provides Tag Helpers that extend the <cache> tag, and add the <cache-dependency-keys> child tag to allow passing of those dependencies.

Additionally, although not caching related, Dependency Injection automation is also something often employed and is included.

Extending

These packages have implementations in Kentico Xperience 13 and Xperience by Kentico, however there is nothing preventing implementations to be written for other platforms, or just MVC itself (using memory cache for example).

If you wish to use these base items and write other implementations, feel free to fork and make a pull request!

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on MVCCaching.Base.Core.Components:

Package Downloads
XperienceCommunity.DevTools.MVCCaching

Adjusted Get Default Language to fall back to Content Default Language. Changed ICachingReferenceService to ICacheReferenceService to fit other ICache motif.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
8.0.0 165 10/4/2024
4.4.0 291 10/26/2023
4.3.0 1,022 6/30/2023
4.2.0 161 6/30/2023

Updated to .net 8.0