Valkey cache
Ownkube runs managed Valkey as a cache deployment. Valkey is in-memory and Redis-compatible, so existing Redis client libraries connect unchanged. Use it for caching, sessions, rate limiting and background job queues.
Create a cache
Section titled “Create a cache”- Press ⌘ K on the dashboard or click New, then choose Cache.
- Pick a box by memory. See Sizes.
- Pick the environment and region of the app that will use it.
- Click Deploy. The Overview tab shows the host, port, password and a ready-made connection string.
okctl deploy create -f cache.json{ "resourceType": "cache", "name": "app-cache", "region": "asia", "environmentId": "<environment-id>", "config": { "engine": "valkey", "version": "8.1", "skuId": "cache-0-5", "maxmemoryPolicy": "allkeys-lru" }}okctl regions list prints the region slugs, okctl environments list the environment ids and okctl boxes list the box ids.
Connect an app
Section titled “Connect an app”Link the cache from the app’s page or with okctl deploy link <app-id> <cache-id>. Ownkube adds these secret variables to the app and rolls it out:
REDIS_URL=redis://default:password@host:6379REDIS_HOST=...REDIS_PORT=6379REDIS_PASSWORD=...Any Redis-compatible client reads REDIS_URL as is. The host is a private network address inside the environment. The password is generated at creation and cannot be changed; okctl deploy connection-info <cache-id> prints it when you need it.
A cache bills a flat monthly price for its box. It has no persistent volume, so there is no storage charge, and a sleeping cache bills nothing.
| Box | Memory | Price per month |
|---|---|---|
| Cache 0.25 | 256 MiB | $2 |
| Cache 0.5 | 512 MiB | $3 |
| Cache 1 | 1 GiB | $5 |
| Cache 2 | 2 GiB | $9 |
| Cache 4 | 4 GiB | $16 |
A cache is bound by memory, not CPU. A Pay as you go account can use up to Cache 1. Resize from Settings > Box: you can move up, not down, and the cache restarts briefly.
Memory limit and eviction policy
Section titled “Memory limit and eviction policy”Max memory defaults to the box size and is the limit Valkey evicts against. Eviction policy decides what happens when the cache is full:
| Policy | Behaviour |
|---|---|
allkeys-lru (default) | Evict the least recently used key, whether or not it has a TTL. Right for a pure cache. |
allkeys-lfu | Evict the least frequently used key. |
volatile-lru, volatile-lfu, volatile-ttl, volatile-random | Only evict keys that have a TTL. Keys without one are never dropped. |
allkeys-random | Evict a random key. |
noeviction | Return an error on writes once full. Right for a queue, where losing an item is worse than a failed push. |
The policies are the standard Valkey ones; the Valkey docs describe each in depth.
Public access
Section titled “Public access”A cache is private by default. Turn on Public access on the Settings tab to reach it from a local tool or a GUI client. You get a stable public hostname and a TLS-encrypted rediss:// connection string.
The public endpoint finds your cache by the hostname your client sends in the TLS handshake (SNI). Most client libraries send it automatically from the host in the URL. valkey-cli and redis-cli do not, so pass it with --sni:
valkey-cli -u "rediss://default:<password>@<host>:6379" --sni <host>In a GUI tool such as RedisInsight, set the SNI or server-name field to the same hostname. Without it the connection closes right after the handshake, which most clients report as “Server closed the connection”. okctl connect sets it for you (okctl v0.5.1 and later). Public access is also what the data console and Idle to zero need.
Sleep when idle
Section titled “Sleep when idle”Turn on Idle to zero and a cache nobody is connected to parks itself. The next connection wakes it empty, because a cache keeps nothing across a restart. A sleeping cache bills nothing. See Sleep and wake.