Redis Caching

Distributed key-value caching, session storage, and rate limiting with Upstash or standard Redis.

Lord1Egypt Updated 2 repo stars

File contents

Redis Caching

Overview

Redis is an open-source, in-memory data store used as a database, cache, message broker, and queue.

When to Use This Skill

Use to implement caching, rate limiters, or session persistence across serverless backend instances.

Quick Start (with runnable code examples)

import redis

# Connect to Redis
r = redis.Redis(host='localhost', port=6379, db=0, decode_responses=True)

# Set and Get cached values
r.set('user:session:100', 'active', ex=3600)
session_status = r.get('user:session:100')
print("Session status:", session_status)

Advanced Usage

Implement Redis transactions, pub/sub pipelines, and complex JSON queries.

Key References

Dependencies

  • redis>=5.0.0

Lord1Egypt/ai-skillforge/tree/main/js/skills/gemini/redis-caching commit 9e863928fd

Frequently asked questions

npx skillmds@latest add lord1egypt/redis-caching-2