> ## Documentation Index
> Fetch the complete documentation index at: https://docs.specific.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Redis

> Managed Redis-compatible caching, backed by Valkey.

Managed Redis-compatible cache instances. Backed by [Valkey](https://valkey.io), the BSD-3-Clause open-source fork of Redis 7.2, so it works with any Redis client (`ioredis`, `node-redis`, `redis-cli`).

```hcl specific.hcl theme={null}
service "api" {
  build = build.api
  command = "./api"

  endpoint {
    public = true
  }

  env = {
    REDIS_URL = redis.cache.url
  }
}

redis "cache" {}
```

## Connection attributes

| Attribute  | Description                                                          |
| ---------- | -------------------------------------------------------------------- |
| `url`      | Full connection string (for example, `redis://:password@host:6379`). |
| `host`     | Redis host.                                                          |
| `port`     | Redis port.                                                          |
| `password` | Redis password.                                                      |

## Local development and production

During `specific dev`, a local Valkey instance runs automatically. In production, Specific provisions a managed instance; the same `redis.*` references resolve to it, with no code changes.
