Configures Redis integration in Orchard Core: cache, message bus, distributed locking, data protection, health checks, SignalR backplane, and multi-instance deployment.
Ships in orchardcore. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
You are an Orchard Core expert. Generate code and configuration for Redis integration including Redis cache, message bus, distributed locking, data protection, health checks, configuration, key storage, and multi-instance deployment.
OrchardCore.Redis as the base feature for Redis configuration support.OrchardCore.Redis.Cache for distributed caching using Redis as the IDistributedCache backend.OrchardCore.Redis.Bus for distributed ISignal service, making cache invalidation work across multiple application instances.OrchardCore.Redis.Lock for distributed locking using Redis.OrchardCore.Redis.DataProtection for storing ASP.NET Core Data Protection keys in Redis.OrchardCore:Redis:Configuration (env var OrchardCore__Redis__Configuration, Key Vault secret OrchardCore--Redis--Configuration). Without it (or when it is invalid) an error is logged and the tenant keeps running without Redis: Cache, Bus, Lock, DataProtection and the SignalR backplane fall back to the default implementations, and the health check reports Redis as unhealthy.InstancePrefix to namespace all Redis keys and prevent collisions between environments or applications.ISignal cache invalidation propagates across all nodes.{ "steps": [...] }.sealed modifier.OrchardCore.SignalR.Redis reuses the same connection for the SignalR backplane.OrchardCore.Redis, inject IRedisService directly; it is always registered (a NullRedisService when the configuration is missing or invalid). In a startup that swaps a default service for a Redis-backed one, guard with services.IsRedisConfigured().{
"steps": [
{
"name": "Feature",
"enable": [
"OrchardCore.Redis",
"OrchardCore.Redis.Cache",
"OrchardCore.Redis.Bus",
"OrchardCore.Redis.Lock",
"OrchardCore.Redis.DataProtection"
],
"disable": []
}
]
}
| Feature | Module ID | Description |
|---|---|---|
| Redis | OrchardCore.Redis | Base Redis configuration support |
| Redis Cache | OrchardCore.Redis.Cache | Distributed cache using Redis as IDistributedCache backend |
| Redis Bus | OrchardCore.Redis.Bus | Distributed ISignal service for cross-instance cache invalidation |
| Redis Lock | OrchardCore.Redis.Lock | Distributed locking for coordinating work across instances |
| Redis DataProtection | OrchardCore.Redis.DataProtection | Stores ASP.NET Core Data Protection keys in Redis |
Configure the Redis connection in appsettings.json:
{
"OrchardCore": {
"Redis": {
"Configuration": "localhost:6379,abortConnect=false,connectTimeout=5000",
"InstancePrefix": "MyApp:",
"AllowAdmin": true
}
}
}
| Option | Description | Required |
|---|---|---|
Configuration | The Redis connection string | Yes |
InstancePrefix | A prefix added to all Redis keys to prevent collisions | No |
AllowAdmin | Whether to allow admin commands (enables persistence check) | No (defaults to false) |
For a production multi-instance deployment with SSL:
{
"OrchardCore": {
"Redis": {
"Configuration": "myredis.example.com:6380,password=MySecurePassword,ssl=true,abortConnect=false,connectTimeout=5000,syncTimeout=5000",
"InstancePrefix": "Production:",
"AllowAdmin": true
}
}
}
Redis Data Protection stores keys using the following pattern:
{InstancePrefix}{TenantName}:DataProtection-Keys
Examples:
| InstancePrefix | Tenant | Redis Key |
|---|---|---|
MyApp: | Default | MyApp:Default:DataProtection-Keys |
MyApp: | Tenant1 | MyApp:Tenant1:DataProtection-Keys |
| (none) | Default | Default:DataProtection-Keys |
The OrchardCore.Redis.DataProtection feature stores ASP.NET Core Data Protection keys in Redis. This is essential for:
OrchardCore.Redis feature enabled and configured.OrchardCore.Redis.DataProtection feature enabled.Data protection keyrings are not cache files and must be kept in durable storage. Ensure Redis has a backup strategy:
The module automatically checks if persistence is enabled (when AllowAdmin is true) and logs a warning if it is not configured.
When OrchardCore.Redis.Cache is enabled, Redis replaces the default in-memory IDistributedCache. All Orchard Core features that use IDistributedCache automatically benefit from distributed caching.
Use IDistributedCache to store and retrieve cached data:
using Microsoft.Extensions.Caching.Distributed;
public sealed class CachedProductService
{
private readonly IDistributedCache _cache;
public CachedProductService(IDistributedCache cache)
{
_cache = cache;
}
public async Task<string?> GetProductAsync(string productId)
{
return await _cache.GetStringAsync($"product:{productId}");
}
public async Task SetProductAsync(string productId, string data)
{
var options = new DistributedCacheEntryOptions
{
AbsoluteExpirationRelativeToNow = TimeSpan.FromMinutes(30),
SlidingExpiration = TimeSpan.FromMinutes(10),
};
await _cache.SetStringAsync($"product:{productId}", data, options);
}
}
When OrchardCore.Redis.Bus is enabled, the ISignal service becomes distributed. Cache invalidation signals propagate across all application instances via Redis Pub/Sub.
This is critical for multi-instance deployments. Without Redis Bus, signaling cache invalidation on one instance does not affect other instances.
using OrchardCore.Environment.Cache;
public sealed class ProductCacheInvalidator
{
private readonly ISignal _signal;
public ProductCacheInvalidator(ISignal signal)
{
_signal = signal;
}
public async Task InvalidateAsync()
{
// This signal propagates to ALL instances via Redis Bus.
await _signal.SignalTokenAsync("productcatalog");
}
}
When OrchardCore.Redis.Lock is enabled, Orchard Core uses Redis for distributed locking via IDistributedLock. This ensures only one instance executes a critical section at a time:
using OrchardCore.Locking.Distributed;
public sealed class ImportService
{
private readonly IDistributedLock _distributedLock;
public ImportService(IDistributedLock distributedLock)
{
_distributedLock = distributedLock;
}
public async Task RunImportAsync()
{
var (locker, locked) = await _distributedLock.TryAcquireLockAsync(
"IMPORT_LOCK",
TimeSpan.FromMinutes(5),
TimeSpan.FromSeconds(30));
if (!locked)
{
return; // Another instance is already running the import.
}
await using var _ = locker;
// Perform the import safely knowing no other instance is doing it.
await ExecuteImportAsync();
}
private Task ExecuteImportAsync()
{
// Import logic here.
return Task.CompletedTask;
}
}
The Redis module provides a health check to report the status of the Redis server. This integrates with ASP.NET Core health checks and can be used for load balancer probes.
Enable the health check feature:
{
"steps": [
{
"name": "Feature",
"enable": [
"OrchardCore.Redis",
"OrchardCore.HealthChecks"
],
"disable": []
}
]
}
OrchardCore.SignalR.Redis (depends on OrchardCore.SignalR and OrchardCore.Redis) routes SignalR messages across instances through Redis, with a tenant-qualified channel prefix. It reads OrchardCore:Redis:Configuration; do not also enable OrchardCore.SignalR.Azure on the same tenant.IDistributedCache and their chunk locks in IDistributedLock, so OrchardCore.Redis.Cache and OrchardCore.Redis.Lock make resumable uploads safe across instances. Chunk data itself stays on the temp file system or in Azure/S3 (see orchardcore-media-gallery).{
"steps": [
{
"name": "Feature",
"enable": [
"OrchardCore.Redis",
"OrchardCore.Redis.Cache",
"OrchardCore.Redis.Bus",
"OrchardCore.Redis.Lock",
"OrchardCore.Redis.DataProtection",
"OrchardCore.SignalR.Redis"
],
"disable": []
}
]
}
IRedisService (OrchardCore.Redis.Abstractions) exposes ConnectAsync(), Connection, Database and InstancePrefix. Connection and Database stay null until a connection is created, which can fail, and are always null for NullRedisService:
using Microsoft.Extensions.Logging;
using OrchardCore.Environment.Shell;
using OrchardCore.Redis;
public sealed class CounterService
{
private readonly IRedisService _redis;
private readonly string _prefix;
private readonly ILogger _logger;
public CounterService(IRedisService redis, ShellSettings shellSettings, ILogger<CounterService> logger)
{
_redis = redis;
_prefix = redis.InstancePrefix + shellSettings.Name + ':';
_logger = logger;
}
public async Task<long> IncrementAsync(string key)
{
if (_redis.Database is null)
{
await _redis.ConnectAsync();
if (_redis.Database is null)
{
return 0;
}
}
try
{
return await _redis.Database.StringIncrementAsync(_prefix + key);
}
catch (Exception e)
{
_logger.LogError(e, "Unable to increment '{KeyName}'.", _prefix + key);
return 0;
}
}
}
Only replace a default implementation with a Redis one when Redis is configured:
public sealed class Startup : StartupBase
{
public override void ConfigureServices(IServiceCollection services)
{
if (services.IsRedisConfigured())
{
services.AddSingleton<ICounterStore, RedisCounterStore>();
}
}
}
For load-balanced or multi-instance Orchard Core deployments using Redis:
OrchardCore.Redis and configure the connection string.OrchardCore.Redis.Cache so all instances share the same distributed cache.OrchardCore.Redis.Bus so ISignal cache invalidation propagates across all nodes.OrchardCore.Redis.Lock to coordinate background tasks and prevent duplicate work.OrchardCore.Redis.DataProtection so all instances share data protection keys.InstancePrefix to namespace keys and prevent collisions with other applications sharing the same Redis instance.AllowAdmin: true in configuration so the module can verify persistence is enabled.OrchardCore.SignalR.Redis when SignalR features (such as OrchardCore.Media.SignalR) must reach clients on every instance.OrchardCore_Redis section to Redis (OrchardCore:Redis:Configuration).OrchardCore__OrchardCore_Redis__Configuration becomes OrchardCore__Redis__Configuration; Key Vault secret OrchardCore--OrchardCore---Redis--Configuration becomes OrchardCore--Redis--Configuration.IRedisService is now always registered while OrchardCore.Redis is enabled. Remove serviceProvider.GetService<IRedisService>() null checks, and replace services.Any(d => d.ServiceType == typeof(IRedisService)) with services.IsRedisConfigured(); otherwise tenants without a Redis configuration get Redis-backed replacements.RedisHealthCheck's constructor takes an IRedisService instead of an IServiceProvider; code constructing it directly instead of calling AddRedisCheck() must be updated.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/orchardcore:orchardcore-redisfrom orchardcore
npx claudepluginhub crestapps/crestapps.agentskills --plugin orchardcore140 skills in this plugin
/orchardcore-adminGuidance for the Orchard Core admin panel, including admin controllers and routes, admin menu registration with AdminNavigationProvider, ocat editor forms grouped in cards, admin pages rendering Model.Editor, the UI text casing standard, TheAdmin layout and menu colors, admin branding, the Navbar shape, the Ctrl+K quick navigation palette and QuickNavigationSource, AdminSettings such as MenuBehavior, ShowBreadcrumb, DisplayQuickNavigation, DisplayTitlesInTopbar and ActionsLayout, the AdminDashboard shape, settings pages, and admin filters and zones. Use this skill when requests mention the Orchard Core admin panel, TheAdmin, admin controllers, admin menu registration, an icon on an admin menu item, the AdminSettings recipe step, quick navigation, navigation menu behavior, the admin URL prefix, UI text casing. Strong matches include OrchardCore.Admin, AdminSettings, AdminPermissions, AdminOptions, AdminAttribute, SiteDisplayDriver, IDisplayManager./orchardcore-admin-dashboardSkill for creating admin dashboard widgets in Orchard Core. Covers the DashboardWidget stereotype, DashboardPart position and sizing, the built-in HtmlDashboardWidget, ContentsMetadata and ContentsTags widget types, custom widget content types via recipe or migration, arranging widgets in Manage Dashboard mode, widget template customization, provisioning widgets with recipes, dashboard permissions, the DashboardBreadcrumbProvider Dashboard ancestor, and the AdminDashboardContent shape used when the feature is disabled. Use this skill when requests mention Orchard Core Admin Dashboard, Create and Configure Dashboard Widgets, Enabling Admin Dashboard, Widget Configuration Properties, dashboard widget recipes, Dashboard breadcrumb, or related implementation, setup, or troubleshooting work. Strong matches include OrchardCore.AdminDashboard, DashboardPart, DashboardBreadcrumbProvider, AccessAdminDashboard, ManageAdminDashboard.Other plugins' skills for the same job