---
title: Caches
url: /docs/caches/
canonical_url: https://blossom88.com/docs/caches/
markdown_url: https://blossom88.com/docs/caches.md
summary: Create and operate Redis and Memcached caches
categories:
  - data
  - caches
---

# Caches

Run Redis or Memcached with a private endpoint and a connection URL delivered
to your App. Create a Cache under **Data → Caches**, or use the CLI below.

| Engine | Use it for | Protection |
|---|---|---|
| [Redis](/docs/caches/redis/) | Persistent cached data and queues | Append-only persistence, recovery backups, replicas and optional standby |
| [Memcached](/docs/caches/memcached/) | Values your App can recompute | Recreated empty after failure |

## Availability

| Option | Placement |
|---|---|
| Shared | Your Data Capacity, alongside your other Shared Databases and Caches |
| Dedicated | One node on its own Server and failure boundary |

Shared is the default where the Location offers Data Capacity, otherwise
Dedicated. Shared resources recover together after a Server failure, briefly
pausing connections. See [sizes](/docs/databases/#shared-sizes)
and [pricing](/docs/databases/#pricing).

## Create A Cache

> Add a Redis Cache named production-cache with 10 GiB of storage and backups.

    blossom cache_instance:init

cache_instance.yml:

```yaml
cache_instance:
  name: production-cache
  engine: redis
  availability: shared
  storage_gib: 10
  backup_storage_id: blossom_managed
```

    blossom cache_instance:create --data cache_instance.yml --follow

The selected Location and its capacity ceiling apply. For Memcached, choose
`engine: memcached` and omit storage and backup settings.

## Connect An Environment

Open **Variables and Links → Manage connections** on the Environment, or:

    blossom environment_link:init

environment_link.yml:

```yaml
environment_link:
  environment_id: environment-100
  target_type: CacheInstance
  target_id: cache_instance-100
  var_name: REDIS_URL
```

    blossom environment_link:create --data environment_link.yml

The Cache and Environment must belong to the same Account and region. Redis
links include generated credentials; use `MEMCACHED_URL` for Memcached.
Memcached has no native authentication: keep its endpoint private. See
[Database And Cache Security](/docs/databases/security/).

## Redis Protection

[Backup Storage](/docs/backups/managed-cache/) adds encrypted
recovery backups. Dedicated Redis can have one standby for automatic failover
and up to five read replicas with their own endpoints. A standby requires
Backup Storage and doubles the node and storage charge.

Set **Standby with automatic failover** in Cache settings, or `standby: true`.
Read replicas are added separately. See
[Redis persistence, replicas and failover](/docs/caches/redis/).
Memcached has no backups, replicas or standby.

## Rotate The Redis Password

    blossom cache_instance:credentials:rotate --id cache_instance-100 --follow

Blossom updates Redis and restarts linked Environments with the new URL. The
old password stops working and connections pause briefly. Update clients
outside Environment Links yourself. Memcached has no password to rotate.
For a chosen password, use
[password stdin](/docs/reference/cli/cache_instance/credentials/rotate/).
Other settings are in the [Cache CLI reference](/docs/reference/cli/cache_instance/).

## What You Get

A private Cache connected to your App, with Redis recovery options or
Memcached's simple, disposable storage.
