---
question: Can I mix local and nats_rpc cache tiers?
kind: task
via_web: na
via_cli: na
via_python: na
via_api: na
via_config: available
ref_config: services.cache.adapters
prereq: A project made by `abi new project`, with its `config.yaml`.
next:
  - /capabilities/build/platform/cache-a-function
  - /capabilities/build/platform/cache-overview
---

# Choose a backend

`services.cache.adapters` is the list of tiers. A read tries them in order, `hot` first by convention. A `set_*` call writes the `cold` tier only.

## Web UI

Not applicable. Nexus does not edit `config.yaml`. Super admins can see the adapters a config file sets at `/organizations/<org>/settings/services` (Organization Settings › Services, not listed in the settings menu). Use the Config steps on this page.

## CLI

Not applicable. No `abi` command picks a backend. After you edit the block, `abi config validate` checks it: see the Config steps on this page.

## Python

Not applicable. The engine builds the cache from `config.yaml` when it starts. Use the Config steps on this page.

## REST API

Not applicable. `GET /api/admin/services` lists the adapter names a config file sets, for super admins; nothing changes them. Use the Config steps on this page.

## Config

### Pick the tiers

| Adapter | Use it for | Keys |
|---|---|---|
| `fs` | A cold tier on local disk | `base_path` (default `storage/cache`) |
| `object_storage` | A cold tier shared by every process that shares object storage | `cache_prefix` (default `cache`) |
| `redis` | A hot tier | `redis_url` (default `redis://localhost:6379/0`), `prefix` (default `naas:cache`), `socket_timeout` |
| `keyvalue` | A tier in the engine's key-value store, not a Redis cache | `cache_prefix` (default `cache`) |
| `nats_rpc` | Another engine's cache, in NATS mode | `nats_url`, `jwt_secret`, `service_identity` |

Every adapter except `custom` needs a `config:` block, even an empty one. `object_storage` and `keyvalue` load those services too.

### Write the block

```yaml title="config.yaml"
services:
  cache:
    adapters:
      - adapter: redis
        tier: hot
        config:
          redis_url: "{{ secret.REDIS_URL }}"
          prefix: "naas:cache"
      - adapter: fs
        tier: cold
        config:
          base_path: "storage/cache"
```

A single entry without `tier` is the cold tier. Without a `cache:` block the engine uses Redis at `redis://localhost:6379/0` as `hot` and `object_storage` as `cold`.

### Check it

```bash
abi config validate
```

It prints `Configuration is valid`, or the key that is wrong. In NATS mode every tier is local, or every tier is `nats_rpc`: a mix fails here with "NATS mode cannot mix local and remote cache tiers".

### Restart

The engine reads `config.yaml` when it starts. Restart it to use the new tiers. Entries already in the old tiers are not moved.

The same block is on the [Configuration Reference](/user-guide/get-started/configuration#cache).
