---
id: cache--redis-delete
title: "Redis delete"
summary: "Deletes one key from a Redis cache and emits what was stored under it. Use it to invalidate cache entries or to take a value out of the cache once."
audience: user
keywords: "input, deleted, nodata, connectionstring, storagemode, instancename, connecttimeoutms, synctimeoutms, cacertificate, clientcertificate, key, value, ttl, slidingttl, condition"
---
# Redis delete

Deletes one key from a Redis cache and emits what was stored under it. Use it to invalidate cache entries or to take a value out of the cache once.

## Pins

| Pin | Kind | Types | Description |
|---|---|---|---|
| Input | input | any | The record the `Key` expression reads. |
| Deleted | output | type of the connection | What was stored: the JSON deserialized into the connection's type. `Viaducta.Plugins.TextPlugin.Types.TextRecord` gives the raw stored text (`Value`) and the key (`Name`). |
| NoData | no data | same as input | The unchanged input, when there was nothing to delete. |

## Configuration

The configuration is shared with Redis read and Redis write; fields marked *write only* have no effect here.

| Field | Type | Default | Description |
|---|---|---|---|
| `ConnectionString` | string (max 2048) | | Required. StackExchange.Redis configuration string, e.g. `redis1:6379,ssl=true,password=...,defaultDatabase=0`. |
| `StorageMode` | dropdown: `0` String, `1` DistributedCache | `0` | `0`: plain Redis strings. `1`: the `IDistributedCache` hash format. Must match how the key was written. |
| `InstanceName` | string (max 255) | | Visible with `StorageMode` `1`. Prefix in front of every key, the `RedisCacheOptions.InstanceName` of the scripts. |
| `ConnectTimeoutMs` | integer (min 1) | `5000` | Connect timeout in milliseconds. |
| `SyncTimeoutMs` | integer (min 1) | `5000` | Timeout of one operation in milliseconds. |
| `CaCertificate` | certificate name | | CA that signed the server certificate (`ssl=true`, private CA). Empty: OS trust store. |
| `ClientCertificate` | certificate name | | Client certificate with private key for mutual TLS. |
| `Key` | string (max 1024) | | Required. The key, usually an expression: `session:{data.SessionId}`. |
| `Value` | text | | Write only. |
| `Ttl` | integer (min 0) | `3600` | Write only. |
| `SlidingTtl` | integer (min 0) | `0` | Write only. |
| `Condition` | dropdown: `0` Always, `1` Only if missing | `0` | Write only. |

## Behaviour

- `Key` is evaluated for every record: `{data.X}` is the input, `{meta.X}` the metadata, `{config.X}` the flow configuration. An empty key fails that record.
- String mode deletes with `GETDEL` (Redis 6.2 or newer): atomic, two components never get the same value. DistributedCache mode reads, then removes: not atomic.
- The key is deleted even when nothing is connected to `Deleted`, or when the value isn't JSON of the `Deleted` type (that record then fails with the key already gone).
- The connection is opened at flow start and shared by all Redis components on the Host with the same connection string, timeouts and certificates. A wrong connection string, a missing certificate or an unreachable server stops the flow at start.
- A timeout or lost connection fails that record (recoverable error); the next record is tried again.

## Notes

- Values are JSON written by `ViaJsonSerializer` (default options, UTF-8), the serializer the scripts use.
- Keep the password in an expression setting: `"ConnectionString": "=Secrets.RedisConnection"`.

## Example

Invalidate a cached customer when it changes:

```json
{ "ConnectionString": "=Secrets.RedisConnection", "Key": "customer:{data.CustomerId}" }
```

Webhook receiver → Json deserializer → **Redis delete** ─ Deleted / NoData → Http response
