v8

latestOpenAPI 3.0.0Apache 2.0raw.githubusercontent.com2025-10-165266542.4 MB
DigitalOcean-public.v2-new_Databases

Configure the Eviction Policy for a Caching or Valkey Cluster

To configure an eviction policy for an existing Caching or Valkey cluster, send a PUT request to /v2/databases/$DATABASE_ID/eviction_policy specifying the desired policy.

put/v2/databases/{database_cluster_uuid}/eviction_policy

Path parameters

database_cluster_uuidstring uuid required

A unique identifier for a database cluster.

Request body

eviction_policy'noeviction' | 'allkeys_lru' | 'allkeys_random' | 'volatile_lru' | 'volatile_random' | 'volatile_ttl' required

A string specifying the desired eviction policy for a Caching or Valkey cluster.

  • noeviction: Don't evict any data, returns error when memory limit is reached.
  • allkeys_lru: Evict any key, least recently used (LRU) first.
  • allkeys_random: Evict keys in a random order.
  • volatile_lru: Evict keys with expiration only, least recently used (LRU) first.
  • volatile_random: Evict keys with expiration only in a random order.
  • volatile_ttl: Evict keys with expiration only, shortest time-to-live (TTL) first.

Example request

{
  "eviction_policy": "allkeys_lru"
}

Response

The action was successful and the response body is empty.