remix-cachelisted
Install: claude install-skill aiskillstore/marketplace
# Remix Cache Skill
Expert guidance for using remix-cache, a production-ready caching library for Remix applications.
## When to use this skill
Use this skill when the user asks about:
- Implementing caching in Remix applications
- Redis-backed caching strategies
- Cache invalidation (by key, tag, or pattern)
- Real-time cache synchronization with SSE
- Stale-while-revalidate patterns
- Type-safe cache definitions
- React hooks for automatic revalidation
- Performance optimization with caching
- Server vs serverless caching modes
- Circuit breaker patterns for cache failures
## Quick reference
### Basic setup
```typescript
// app/cache.server.ts
import { createCache } from 'remix-cache/server'
export const cache = createCache({
redis: { host: process.env.REDIS_HOST, port: 6379 },
prefix: 'myapp',
})
export const userCache = cache.define({
name: 'user',
key: (userId: string) => userId,
fetch: async (userId: string) => db.user.findUnique({ where: { id: userId } }),
ttl: 300,
})
```
### Use in loaders
```typescript
export async function loader({ params }: LoaderFunctionArgs) {
const user = await userCache.get(params.userId)
return json({ user })
}
```
### Invalidation
```typescript
// By key
await cache.invalidate({ key: 'myapp:user:123' })
// By tag
await cache.invalidateByTag('product')
// By pattern
await cache.invalidateByPattern('user:*')
```
### Real-time React revalidation
```typescript
// app/root.tsx
<CacheProvider endpoint="/api/cache-ev