Provides read-only single-entity-by-id caching via IEntityCache with auto-invalidation on entity update/delete. Use for caching entities or DTOs with batch lookups and expiration.
Ships in abp-runtime. 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.
IEntityCache<TEntityCacheItem, TKey> is ABP's higher-level abstraction on top of the distributed cache. Unlike a raw IDistributedCache<T> where you manage keys and invalidation yourself, an entity cache knows how to load an entity from its repository, cache it, and automatically invalidate the cached copy when the entity is updated or deleted — so the next call re-reads from the database and re-caches.
Source: https://github.com/abpframework/abp/blob/rel-10.5/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Caching/IEntityCache.cs and https://github.com/abpframework/abp/blob/rel-10.5/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Caching/EntityCacheServiceCollectionExtensions.cs.
Product referenced from many places) and want caching without hand-writing cache keys or invalidation logic.IDistributedCache<T>).Call AddEntityCache in your module's ConfigureServices. The two-generic form caches the entity object directly (the entity must be JSON-serializable):
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddEntityCache<Product, Guid>();
}
Registration constraints (from the source): TEntity : Entity<TKey> and TKey : notnull.
Then inject IEntityCache<Product, Guid> and read:
public class ProductAppService : ApplicationService, IProductAppService
{
private readonly IEntityCache<Product, Guid> _productCache;
public ProductAppService(IEntityCache<Product, Guid> productCache)
=> _productCache = productCache;
public async Task<ProductDto> GetAsync(Guid id)
{
var product = await _productCache.GetAsync(id); // DB first call, cache afterwards
return ObjectMapper.Map<Product, ProductDto>(product);
}
}
Internally the entity cache stores each item in an IDistributedCache<EntityCacheItemWrapper<TEntityCacheItem>, TKey>, so the cache name defaults to the full type name of EntityCacheItemWrapper<TEntityCacheItem> (e.g. Volo.Abp.Domain.Entities.Caching.EntityCacheItemWrapper\1[[...Product...]]), not the name ofProductorProductDto. Because the resolved cache-item type is the wrapper, a[CacheName]attribute placed onProduct` or the cached DTO does not change this cache name.
From https://github.com/abpframework/abp/blob/rel-10.5/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Caching/IEntityCache.cs — note the generic is <TEntityCacheItem, TKey>, i.e. the type you inject is the cached item type, not necessarily the entity:
public interface IEntityCache<TEntityCacheItem, TKey>
where TEntityCacheItem : class
where TKey : notnull
{
Task<TEntityCacheItem?> FindAsync(TKey id); // null if missing
Task<List<TEntityCacheItem?>> FindManyAsync(IEnumerable<TKey> ids); // order preserved
Task<Dictionary<TKey, TEntityCacheItem?>> FindManyAsDictionaryAsync(IEnumerable<TKey> ids);
Task<TEntityCacheItem> GetAsync(TKey id); // throws if missing
Task<List<TEntityCacheItem>> GetManyAsync(IEnumerable<TKey> ids);
Task<Dictionary<TKey, TEntityCacheItem>> GetManyAsDictionaryAsync(IEnumerable<TKey> ids);
}
FindAsync returns null when the entity is not found; GetAsync throws EntityNotFoundException.*Many* methods batch-fetch only the cache-missed ids from the database, so prefer them over calling FindAsync/GetAsync in a loop.If the entity isn't JSON-serializable, or you'd rather cache a leaner shape, register the three-generic form. ABP performs the object mapping from entity to cache item for you:
context.Services.AddEntityCache<Product, ProductDto, Guid>();
You must configure the Product -> ProductDto mapping (AutoMapper, Mapperly, etc.):
public class MyMapperProfile : Profile
{
public MyMapperProfile() => CreateMap<Product, ProductDto>();
}
Now inject IEntityCache<ProductDto, Guid> — GetAsync returns the DTO directly:
public class ProductAppService : ApplicationService, IProductAppService
{
private readonly IEntityCache<ProductDto, Guid> _productCache;
public ProductAppService(IEntityCache<ProductDto, Guid> productCache)
=> _productCache = productCache;
public Task<ProductDto> GetAsync(Guid id) => _productCache.GetAsync(id);
}
Every AddEntityCache overload takes an optional DistributedCacheEntryOptions:
context.Services.AddEntityCache<Product, ProductDto, Guid>(
new DistributedCacheEntryOptions
{
SlidingExpiration = TimeSpan.FromMinutes(30)
});
The default is a 2-minute AbsoluteExpirationRelativeToNow.
For full control over how an entity becomes a cache item, derive from EntityCacheWithObjectMapper<TEntity, TCacheItem, TKey>, override MapToValue, and register with ReplaceEntityCache<TCache, TEntity, TCacheItem, TKey>(...).
IEntityCache<Product, Guid> for the two-generic form, IEntityCache<ProductDto, Guid> for the DTO form. A wrong generic won't resolve.GetAsync(id) reads from the DB, subsequent calls read from cache.Product -> ProductDto mapping is configured, or mapping will fail.IEntityCache<Product, Guid>); with the DTO registration it's the DTO (IEntityCache<ProductDto, Guid>).[CacheName] on Product or the DTO does not change the cache name; the resolved cache-item type is EntityCacheItemWrapper<TEntityCacheItem>, so the default name comes from the wrapper.*Many* methods over looping FindAsync/GetAsync; they batch-fetch only cache-missed ids.What SKILL.md sets; muted values are Claude Code's defaults
/abp-runtime:cache-entitiesfrom abp-runtime
npx claudepluginhub abpframework/abp-skills --plugin abp-runtime10 skills in this plugin
/background-jobs-and-eventsIn-process/cross-service events, entity change reactions, deferred/recurring background work. USE FOR: ILocalEventBus / IDistributedEventBus, EntityCreated/Updated/DeletedEventData, [EventName] ETOs, IBackgroundJobManager jobs, AsyncPeriodicBackgroundWorkerBase workers. DO NOT USE FOR: distributed cache/lock (distributed-caching-and-locking); SignalR push (add-signalr-realtime); microservice message contracts (design-module-and-service-communication)./configure-app-urlsNamed application roots and external URLs with AppUrlOptions, resolved tenant-aware via IAppUrlProvider. USE FOR: AppUrlOptions.Applications; RootUrl and named Urls; email links; cross-application links; tenantId and tenantName placeholders; redirect allow-list checks. DO NOT USE FOR: rendering the email body (render-text-templates) or sending it (send-emails); remote service base addresses (consume-remote-services); resolving tenants by domain (configure-multi-tenancy)./configure-production-hostingRelease checklist for hosting an ABP app in production behind a reverse proxy or clustered. USE FOR: forwarded headers, shared Data Protection keys, cluster cache/lock, single/multi-instance jobs/workers, SignalR scale-out, shared KeyPrefix. DO NOT USE FOR: the cache/lock APIs (distributed-caching-and-locking); job/worker mechanics (background-jobs-and-events); SignalR hubs (add-signalr-realtime); OpenIddict prod certs (configure-openiddict-authentication).Other plugins' skills for the same job