Funpixart.Components.Cache
1.0.4
dotnet add package Funpixart.Components.Cache --version 1.0.4
NuGet\Install-Package Funpixart.Components.Cache -Version 1.0.4
<PackageReference Include="Funpixart.Components.Cache" Version="1.0.4" />
<PackageVersion Include="Funpixart.Components.Cache" Version="1.0.4" />
<PackageReference Include="Funpixart.Components.Cache" />
paket add Funpixart.Components.Cache --version 1.0.4
#r "nuget: Funpixart.Components.Cache, 1.0.4"
#:package Funpixart.Components.Cache@1.0.4
#addin nuget:?package=Funpixart.Components.Cache&version=1.0.4
#tool nuget:?package=Funpixart.Components.Cache&version=1.0.4
Funpixart.Component.Cache
Introduction This project contains everything relevant to the Funpixart.Component.Cache component [FP.Cache]. This component provides an abstraction layer over ASP.NET Core's Output Caching system, with support for Redis and in-memory cache, facilitating cache strategy implementation through typed policies and automatic tag-based invalidation management.
Description The FP.Cache repository contains the cache component with the following main classes:
- CacheOptions.cs - Configuration for cache options (Redis/In-Memory)
- CachePolicy.cs - Cache policy definition with expiration, tags and variations
- CachePolicyProvider.cs - Abstract base class for defining policy providers
- CachePolicyRegistry.cs - Centralized registry for cache policies
- CacheServiceExtensions.cs - Extensions for cache service configuration
- ICacheService.cs - Interface for manual cache operations
- ICacheSerializer.cs - Interface for custom serialization implementations
- JsonCacheSerializer.cs - Default JSON serialization implementation
- OutputCacheService.cs - ICacheService implementation using IOutputCacheStore
- RedisOutputCacheExtensions.cs - Extensions for Redis cache configuration
- RedisOutputCacheStore.cs - Redis cache store implementation
Main parts are described below.
Funpixart.Component.Cache Project
CacheOptions
This area contains basic configurations for the cache component. Defines properties like UseRedis to switch between Redis and In-Memory, along with Redis-specific configurations.
CachePolicy This area defines the fundamental structure of cache policies. Encapsulates information like unique name, expiration time, tags for grouping and invalidation, and query parameters.
CachePolicyProvider
This area contains the abstract base class that users must implement to define their cache policies. Developers inherit from CachePolicyProvider and override the DefinePolicies() method.
CachePolicyRegistry This area contains the centralized registry of all system cache policies. Provides methods to add and retrieve registered policies.
CacheServiceExtensions
This area contains configuration extensions for IServiceCollection. Includes methods like AddCacheConfiguration<T>() that simplify cache service registration.
ICacheService
This area defines the main interface for manual cache operations. Provides methods for GetAsync<T>(), SetAsync<T>() and EvictByTagAsync().
ICacheSerializer This area defines the interface for custom serialization implementations. Users can implement their own serialization logic by implementing this interface.
JsonCacheSerializer This area contains the default JSON-based serialization implementation using System.Text.Json. Provides standard serialization for most use cases.
OutputCacheService
This area contains the concrete implementation of ICacheService that uses IOutputCacheStore and ICacheSerializer internally. Handles serialization, logging and error handling.
RedisOutputCacheExtensions
This area contains Redis-specific configuration extensions. Automatically configures IConnectionMultiplexer and handles transition between providers.
RedisOutputCacheStore
This area contains the specialized implementation of IOutputCacheStore for Redis. Handles Redis connections, get/set operations with expiration, and tag-based invalidation.
Documentation
- 📖 How to Use - Step-by-step guide for implementing the component
- ⚙️ Configuration - Configuration example for appsettings.json
| Product | Versions 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- Microsoft.AspNetCore.OutputCaching.StackExchangeRedis (>= 8.0.4)
- StackExchange.Redis (>= 2.7.33)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.