redis-patterns

Installation
SKILL.md

Redis Patterns

Caching Strategies

async function getUser(userId: string): Promise<User> {
  const cacheKey = `user:${userId}`;
  const cached = await redis.get(cacheKey);

  if (cached) {
    return JSON.parse(cached);
  }

  const user = await db.user.findUnique({ where: { id: userId } });
  if (user) {
    await redis.set(cacheKey, JSON.stringify(user), "EX", 3600);
  }
Related skills
Installs
79
GitHub Stars
1.7K
First Seen
Feb 11, 2026