caching-strategies

Implement caching patterns for ASP.NET Core Razor Pages applications.

71|10|Updated Feb 11, 2026
One-click install
npx skills add https://github.com/wshaddix/dotnet-skills --skill caching-strategies-wshaddix
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: caching-strategies
Source: https://github.com/wshaddix/dotnet-skills/tree/main/skills/caching-strategies
Command: npx skills add https://github.com/wshaddix/dotnet-skills --skill caching-strategies-wshaddix

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses the challenge of improving application performance and reducing server load in ASP.NET Core applications by implementing effective caching strategies.

Core Features & Use Cases

  • Comprehensive Caching Patterns: Covers Output Caching, Response Caching, Memory Caching, Distributed Caching (Redis), and HybridCache (.NET 9+).
  • Cache Invalidation: Provides strategies for effective cache invalidation using tags, events, and time-based policies.
  • Use Case: Implement output caching for frequently accessed, non-user-specific pages to drastically reduce response times and server resource consumption.

Quick Start

Configure output caching for a Razor Page by adding the [OutputCache] attribute with a duration of 60 seconds.

Frequently Asked Questions about caching-strategies

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

FAQPage Schema
How do I implement caching in ASP.NET Core Razor Pages to improve performance?

You can implement caching in ASP.NET Core Razor Pages by applying the `[OutputCache]` attribute with a duration to frequently accessed pages, utilizing output caching, response caching, or memory caching patterns to reduce response times and server load.

What's the difference between memory caching and distributed caching with Redis in ASP.NET Core?

Memory caching stores data in the application's local memory, while distributed caching with Redis stores data across multiple servers. This Skill provides patterns for choosing between them based on your application's scaling requirements.

Does this Skill support HybridCache for .NET 9 applications?

Yes, this Skill supports HybridCache for .NET 9+ applications. It implements comprehensive caching patterns covering HybridCache alongside output caching, memory caching, and distributed caching with Redis to optimize application performance.

How do I handle cache invalidation in ASP.NET Core applications?

To handle cache invalidation in ASP.NET Core, this Skill provides strategies using tags, events, and time-based policies. These approaches ensure effective invalidation when underlying data changes or expires.

When should I use output caching versus response caching in Razor Pages?

You should use output caching for frequently accessed, non-user-specific Razor Pages to reduce response times. This Skill covers both output caching and response caching patterns to help you choose the appropriate approach for your application's performance optimization needs.