Query Caching Strategies
Multi-level query caching guide for Redis, Memcached, and database-level caches with invalidation patterns.
- CCM score
- 35 of 100
- skills.sh installs
- 466
- GitHub stars
- 396
- last updated
- Aug 21, 2026
Own this skill? Claim it
What it does
- Covers multi-level caching with Redis, Memcached, and database-level caches, plus cache invalidation, TTL strategies, and cache warming
- Includes six reference guides: Redis with PostgreSQL, Memcached, PostgreSQL and MySQL query caches, event-based invalidation, and time-based invalidation with LRU eviction
- Provides a Node.js quick start that checks Redis before querying the database and caches results with a one-hour TTL
- Designed for setting up caching layers, configuring Redis, and reducing database load on high-read workloads
Install
$ npx -y skills add aj-geddes/useful-ai-prompts --skill query-caching-strategies -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
Query Caching Strategies
Table of Contents
Overview
Implement multi-level caching strategies using Redis, Memcached, and database-level caching. Covers cache invalidation, TTL strategies, and cache warming patterns.
When to Use
- Query result caching
- High-read workload optimization
- Reducing database load
- Improving response time
- Cache layer selection
- Cache invalidation patterns
- Distributed cache setup
Quick Start
Minimal working example:
// Node.js example with Redis
const redis = require("redis");
const client = redis.createClient({
host: "localhost",
port: 6379,
db: 0,
});
// Get user with caching
async function getUser(userId) {
const cacheKey = `user:${userId}`;
// Check cache
const cached = await client.get(cacheKey);
if (cached) return JSON.parse(cached);
// Query database
const user = await db.query("SELECT * FROM users WHERE id = $1", [userId]);
Details
- Repository
- github.com/aj-geddes/useful-ai-prompts
- Categories
- Databases, Backend & APIs
- First seen
- Jun 3, 2026
Questions
What does the query-caching-strategies skill do?
It implements query caching strategies to improve performance, covering Redis, Memcached and database-level caching. It also covers cache invalidation, TTL strategies and cache warming patterns for speeding up database query response times.
When should I use the query-caching-strategies skill?
Use it when setting up caching layers, configuring Redis, or optimizing database query response times. It also fits high-read workloads, reducing database load and choosing a cache layer.
How do I install the query-caching-strategies skill?
Run npx -y skills add aj-geddes/useful-ai-prompts --skill query-caching-strategies -y in your project. The skill then lets the agent guide query result caching with Redis and related patterns.
Which skills sit alongside query-caching-strategies in the Databases category?
It is listed in the Databases category with supabase-postgres-best-practices, prisma-client-api, prisma-database-setup, prisma-cli and prisma-postgres. Where those cover database access and setup, this skill focuses on caching query results.
More from aj-geddes/useful-ai-prompts
All 258- Clustering Analysis464
- Code Metrics Analysis464
- Spring Boot Application464
- Webhook Integration464
- Health Check Endpoints463
- Serverless Architecture463
- Classification Modeling462
- Transaction Management462
- Secrets Rotation461
- Deployment Documentation460
- Natural Language Processing460
- Runbook Creation460
- Autoscaling Configuration458
- Security Documentation458
- Stored Procedures458
- Profiling Optimization457
- Property Based Testing457
- Cpu Profiling456
- Frontend Routing456
- Load Balancer Setup456
- Aws Rds Database455
- Log Aggregation455
- Documentation Site Setup454
- Recommendation System454
Similar to Query Caching Strategies
More Databasescaching-strategyaj-geddes/useful-ai-prompts552 installsCache design guide covering Redis, Memcached, CDN, and invalidation patterns for faster responses and lower database load.
caching-strategistpatricio0312rev/skills279 installsDesign-time caching strategy covering keys, TTLs, invalidation, and stampede prevention for Redis, CDN, and app caches.
redis-patternsaffaan-m/ecc9.1K installsPractical reference for Redis caching, rate limiting, distributed locks, pub/sub, and key design in production backends.
redis-best-practicesmindrally/skills2.3K installsComprehensive Redis development guide covering data structures, caching patterns, and high-availability configuration.
redis-state-managementmanutej/luxor-claude-marketplace491 installsRedis state management guide covering caching, sessions, pub/sub, distributed locks, and data structures with redis-py.