# Redis Caching

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

- Skill: `lord1egypt/redis-caching-2` (Agent Skill)
- Install (CLI): `npx skillmds@latest add lord1egypt/redis-caching-2`
- Raw SKILL.md: https://api.skillmd.com/api/skills/lord1egypt/redis-caching-2/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- License: MIT license
- Author: Lord1Egypt (https://skillmd.com/u/lord1egypt)
- Updated: 2026-09-21
- Page: https://skillmd.com/skills/lord1egypt/redis-caching-2

---


# 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)

```python
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
- [Redis Python Client](https://github.com/redis/redis-py)

## Dependencies
- redis>=5.0.0

