Install any skill in seconds. Free to start, no credit card required.
Get Started Free →github/upstash-redis
Use Redis over HTTP from serverless and edge runtimes with @upstash/redis, and add rate limiting with @upstash/ratelimit.
Passed 24 of 24 test cases with the skill, and 22 of 24 without it.
2 fixed22 passed either way0 still failing0 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 2 test cases the skill fixed. Same model, same prompt, with and without the skill.
Write a TypeScript function getSession(sessionId: string) using @upstash/redis that retrieves a session payload. When a session is found, extend its expiration time by 24 hours so active users stay logged in without needing to re-create the session.
| Checked | Without skill | With skill |
|---|---|---|
| Calls redis.expire on the session key when session data is present. | Missed | Passed |
The instructions your model reads when the skill loads.
This skill covers the three things serverless apps most often need Redis for: caching, sessions, and rate limiting. The client talks to Redis over HTTP, so it works where a long-lived TCP connection does not (edge middleware, short lived functions). Follow the steps in order; each ends with a checkpoint.
UPSTASH_REDIS_REST_URL and UPSTASH_REDIS_REST_TOKEN.pipeline() or MGET/MSET
when you issue many commands per request; avoid KEYS * in production.JSON.stringify before set or parseInt after get.npm install @upstash/redis @upstash/ratelimit
// lib/redis.ts
import { Redis } from "@upstash/redis";
// Reads UPSTASH_REDIS_REST_URL and UPSTASH_REDIS_REST_TOKEN
export const redis = Redis.fromEnv();
Create the client at module scope, not inside the request handler, so ephemeral caches and pipelines can be reused across invocations.
Checkpoint:
await redis.ping()returns"PONG".
import { redis } from "@/lib/redis";
test cases passed, vs 22 / 24 without
Published skills whose descriptions closely match this one, with their headline benchmark lift.
More skills from the same source and nearby in the registry, with their headline benchmark lift.