# `AshOnetime.Cache`
[🔗](https://github.com/baselabs/ash_onetime/blob/v1.5.0/lib/ash_onetime/cache.ex#L20)

Optional cache behavior contract for completed idempotency responses.

Cache data is never admission authority. PostgreSQL is consulted first on every request,
and a hit is usable only after its claim id, fingerprint, codec, digest, size, and payload
digest match the authoritative claim.

# `delete`

```elixir
@callback delete(cache_key :: binary()) :: :ok | {:error, term()}
```

# `get`

```elixir
@callback get(cache_key :: binary()) ::
  :miss | {:ok, AshOnetime.Cache.Entry.t()} | {:error, term()}
```

# `put`

```elixir
@callback put(
  cache_key :: binary(),
  AshOnetime.Cache.Entry.t(),
  ttl_seconds :: pos_integer()
) ::
  :ok | {:error, term()}
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
