Design and review Redis-backed caching in Workless. Use when changing CacheService usage, key naming, TTL policy, invalidation, tenant-aware caching, or HTML cache coordination in this NestJS monolith.
Use this skill when work touches cache behavior in Workless.
Workless has a central cache abstraction under:
src/core/infrastructure/cache/cache.service.tssrc/core/infrastructure/cache/cache.store.tssrc/core/infrastructure/cache/redis.provider.tsRedis is optional:
ioredisBefore changing cache logic, inspect in this order:
src/core/infrastructure/cache/cache.service.tssrc/core/infrastructure/cache/redis.provider.tssrc/core/http/html-cache.interceptor.ts if page caching is involvedFor an active reference, inspect:
src/modules/crm/services/crm-contact.service.tsCache orchestration belongs in services, not controllers.
Preferred pattern:
CacheService.remember(...)Every business-data cache key must include tenant scope.
Preferred pattern:
<module>:<tenantId>:<resource>:...
Examples:
crm:<tenantId>:contacts:<moduleVersion>:<id>crm:<tenantId>:contacts:list:<moduleVersion>:<collectionVersion>:<digest>crm:<tenantId>:dashboard:<moduleVersion>:<collectionVersion>On create, update, or delete:
Current CRM pattern combines:
crm:module:versioncrm:<tenantId>:contacts:versionThis is the preferred pattern for new module work.
Choose TTL by data volatility:
Current CRM examples:
Data cache:
CacheServiceHTML cache:
src/core/http/html-cache.interceptor.tsDo not mix these concerns.
Avoid these in Workless:
src/infrastructure/cache/* pathsFor cache-related changes:
npm run build when the environment allows it