caching-dotnet

Configure multi-tier L1 memory and Redis L2 caching for ASP.NET Core.

12|2|Updated May 4, 2020
One-click install
npx skills add https://github.com/hoangnh2412/jarvis --skill caching-dotnet
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: caching-dotnet
Source: https://github.com/hoangnh2412/jarvis/tree/main/.opencode/skills/caching-dotnet
Command: npx skills add https://github.com/hoangnh2412/jarvis --skill caching-dotnet

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill eliminates the manual effort of configuring and implementing scalable caching systems for ASP.NET Core backend projects built with the Jarvis framework, removing the need to write repetitive cache registration, configuration, and invalidation logic from scratch.

Core Features & Use Cases

  • Multi-Tier Caching Support: Configure in-memory L1 cache and Redis L2 distributed cache for optimal performance and scalability.
  • Cache-Aside Pattern Implementation: Built-in GetOrSetAsync method for automatic cache population and post-write invalidation for database and external API data.
  • Multi-Instance Cache Sync: Pub/sub based memory cache invalidation across multiple server nodes to prevent stale data in distributed deployments.
  • Use Case: For a multi-instance Jarvis e-commerce backend, use this Skill to cache product query results, sync cache invalidation across all instances when product data is updated, and add OpenTelemetry tracing for Redis connections.

Quick Start

Use the caching-dotnet skill to initialize memory caching for your Jarvis Infrastructure layer and enable Redis distributed cache support for your Host project.

Frequently Asked Questions about caching-dotnet

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I configure Redis distributed caching in ASP.NET Core?

This Skill automates Redis distributed cache registration and appsettings-based configuration for ASP.NET Core projects, enabling L2 distributed cache support without manual setup effort.

What is the cache-aside pattern and how does it work with .NET?

The cache-aside pattern in .NET uses a GetOrSetAsync method for automatic cache population when reading database or external API data, followed by post-write invalidation to ensure data consistency.

How do I sync in-memory cache invalidation across multiple ASP.NET Core instances?

Multi-instance in-memory cache invalidation is synchronized using a pub/sub mechanism that broadcasts invalidation events across server nodes, preventing stale data in distributed deployments.

Can I use both in-memory and Redis caching simultaneously in an ASP.NET Core backend?

Yes, multi-tier caching supports configuring both in-memory L1 cache and Redis L2 distributed cache simultaneously, providing optimal performance and scalability for ASP.NET Core backend projects.

Does this caching approach work with the Jarvis framework?

Yes, this caching implementation is specifically designed for ASP.NET Core backend projects built with the Jarvis framework, initializing memory caching for the Infrastructure layer and Redis for the Host project.