Skip to content
Back to skills

Api Cache Redis

ASecurity

Generate Redis cache service with tenant-prefixed keys to prevent cross-tenant leakage, TTL management, and cache invalidation patterns. Use when caching data or reducing database load.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 27, 2026
toolsbashapidatabase

Works with

  • api

Security analysis

A100/100

Scanned September 27, 2026

npx -y skills add David-Li0406/meta-skill-evloving --skill api-cache-redis --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Api Cache Redis?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Api Cache Redis
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/david-li0406-api-cache-redis/badge)](https://www.skillsdirectory.com/skills/david-li0406-api-cache-redis)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: api-cache-redis
description: Generate Redis cache service with tenant-prefixed keys to prevent cross-tenant leakage, TTL management, and cache invalidation patterns. Use when caching data or reducing database load.
allowed-tools:
  - Read
  - Write
  - Edit
  - Glob
  - Grep
---

# Redis Cache Service

## Purpose

Generate Redis cache service with tenant-prefixed keys to prevent cross-tenant data leakage, TTL management for memory efficiency, and cache invalidation patterns.

## When to Use

- Caching frequently accessed data
- Session storage
- Rate limiting
- Reducing database load
- Tenant-isolated caching

## What It Generates

### Directory Structure

```
apps/api/src/modules/{feature}/services/
├── {feature}-cache.service.ts
├── {feature}-cache.service.spec.ts
└── index.ts
```

## Patterns Enforced

### Tenant-Prefixed Keys

Cache keys use format: `tenant:{tenantId}:{key}`

- Prevents cross-tenant cache pollution
- Enables tenant-wide cache clearing
- Isolates rate limit counters

### TTL Management

- All cache keys have TTL
- Default TTL: 5 minutes (300 seconds)
- Session TTL: 24 hours (86400 seconds)
- No infinite TTL (prevents memory leaks)

### Cache Invalidation

- Pattern-based deletion: `delPattern('tenant:{tenantId}:*')`
- Tag-based invalidation
- Automatic invalidation on updates

## Usage Example

```bash
/skill cache-redis --name=User --methods='cacheUser,cachePermissions,clearUserCache'
```

## Related Files

- [Data Repository](../../core/data-repository/SKILL.md) - Repository using cache
- [BullMQ Queues](../queue-bullmq/SKILL.md) - Queue jobs with caching

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…