Skip to content

Go to the docs contents

Valkey cache (Redis)

An in-memory cache that speaks the Redis protocol, for your sessions, your counters or a job queue. Any Redis client works.

Updated November 9, 2026.

View as Markdown

You, to your agent: Add a Redis cache for the sessions.

What your agent writes

Your agent writes it in while.yaml, at the root of your app:

while.yaml
caches:
  - name: sessions
    memory: 64Mi
  - name: jobs
    memory: 256Mi
    durable: true

What your app receives

Your app receives these environment variables at every deployment:

VariableWhat it holds
REDIS_URLThe address of the first cache, password included.
CACHE_SESSIONS_URLThe address of the sessions cache, under the cache’s name.
CACHE_SESSIONS_PASSWORDIts password.

When to use it

For a cache, sessions or a counter, anything that can be rebuilt. With durable: true, it also serves as a task queue. What must be kept goes in a database.

How it works

A Valkey cache keeps your data in memory and speaks the Redis protocol: any Redis client works. Its password is included in REDIS_URL.

What to know

A cache has a single copy. By default, nothing is kept on disk: a restart empties the cache, and when memory is full, the least used keys go. With durable: true, the data is journaled on disk and never evicted: when memory is full, writes are refused.

Pricing

These prices are the same on every plan, excluding VAT:

ResourcePriceDetails
CPU and memory€17 per vCPU·month and €8.50 per GiB·monthapps by usage, caches by reservation
Volumes€0.15 per GiB·monththe disk of a durable cache

Guides

Connect your agent, it takes care of the rest

To paste into your agent

Read while.sh/agents, then deploy my app with while.

Copy the instructions

No account needed to try: your app is live right away. To keep it, sign in.

A project for your company? Talk to the team: hello@while.sh