openai-caching-proxy-worker
openai-caching-proxy-worker copied to clipboard
feat: Add support for local Redis caching
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.tsto includeLOCAL_REDIS_URL,LOCAL_REDIS_PORT, andLOCAL_REDIS_PASSWORDenvironment variable definitions. - Modified
src/cache.tsto useioredisfor connecting to a local Redis instance. The caching preference order is now Upstash Redis, then Local Redis, then Cloudflare KV. - Added
ioredistopackage.jsondependencies and@types/ioredistodevDependencies. - Updated
wrangler.tomlwith instructions and examples for configuring local Redis via environment variables/secrets or.dev.vars. - Updated
README.mdto document the new local Redis feature, including configuration instructions and the cache priority order.