Skip to content

Conversation

cvaz1306
Copy link

@cvaz1306 cvaz1306 commented Jun 2, 2025

This change introduces the capability to use a local or self-hosted Redis instance for caching responses, in addition to the existing Upstash Redis and Cloudflare KV options.

Modifications include:

  • Updated src/env.ts to include LOCAL_REDIS_URL, LOCAL_REDIS_PORT, and LOCAL_REDIS_PASSWORD environment variable definitions.
  • Modified src/cache.ts to use ioredis for connecting to a local Redis instance. The caching preference order is now Upstash Redis, then Local Redis, then Cloudflare KV.
  • Added ioredis to package.json dependencies and @types/ioredis to devDependencies.
  • Updated wrangler.toml with instructions and examples for configuring local Redis via environment variables/secrets or .dev.vars.
  • Updated README.md to document the new local Redis feature, including configuration instructions and the cache priority order.

This change introduces the capability to use a local or self-hosted Redis
instance for caching responses, in addition to the existing Upstash Redis
and Cloudflare KV options.

Modifications include:
- Updated `src/env.ts` to include `LOCAL_REDIS_URL`, `LOCAL_REDIS_PORT`,
  and `LOCAL_REDIS_PASSWORD` environment variable definitions.
- Modified `src/cache.ts` to use `ioredis` for connecting to a local Redis
  instance. The caching preference order is now Upstash Redis, then
  Local Redis, then Cloudflare KV.
- Added `ioredis` to `package.json` dependencies and `@types/ioredis`
  to `devDependencies`.
- Updated `wrangler.toml` with instructions and examples for configuring
  local Redis via environment variables/secrets or `.dev.vars`.
- Updated `README.md` to document the new local Redis feature,
  including configuration instructions and the cache priority order.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant