# Cache (Valkey)

> Managed Valkey, a Redis-compatible in-memory cache, in one click. Caching, sessions, rate limiting, and job queues, private by default.

Ownkube provisions a managed [Valkey](https://valkey.io/) cache in one click. Valkey is in-memory and Redis-compatible, so existing Redis clients connect unchanged. Choose **Cache** as the resource type, provisioned the same way as a [database](/docs/features/databases).

Use it for caching, sessions, rate limiting, and background or job queues.

## Adding a cache

1. **Choose Cache as the resource type**

   From [**Create deployment**](https://app.ownkube.io/dashboard), pick **Cache** instead of Database.

2. **Size it**

   Pick a memory size from the cache box ladder. See [Sizing](#sizing) below.

3. **Pick an environment**

   Tag the cache to an [environment](/docs/features/environments) like `Development` or `Production`.

4. **Create**

   Ownkube provisions the cache and attaches connection details to the deployment as environment variables.

## Sizing

Pick a memory size from a ladder of cache boxes. A cache box always costs less than a database box of the same memory, since a cache carries no durable-volume line, there's no storage charge. See [Pricing](/docs/configuration/pricing) for the current ladder.

## Connecting your app

When you attach a cache to a deployment, Ownkube injects the connection details as environment variables into your app container:

```bash
REDIS_URL=redis://:password@host:6379
REDIS_HOST=...
REDIS_PORT=6379
REDIS_PASSWORD=...
```

Any Redis-compatible client library connects with these values unchanged, no code changes needed.

**A cache is ephemeral.** It holds data in memory only, with no durable storage behind it. A restart is a cold cache: whatever was in it is gone, and your app needs to repopulate it. This is the standard tradeoff for a cheap cache tier, don't store anything in it you can't afford to lose.

## Private by default

A new cache has no public endpoint, reachable only from your own deployments over a private connection string. As with databases, a public edge is available as an opt-in for cases like connecting from a local tool, keep it off unless you need it. See [Databases](/docs/features/databases#public-access) for how public access works on the same model.

- [Databases](/docs/features/databases)
- [Pricing](/docs/configuration/pricing)

---

**Don't see a feature you need?** Email [support@ownkube.io](mailto:support@ownkube.io?subject=Feature%20request). Ownkube is shaped by the teams using it and we ship what our users ask for.
