set

fun set(key: K, value: V, ttl: Duration)

Save the specified key with value in this cache.

  • If the cache is full, the oldest entry will be evicted.

  • If the key already exists, delete the old entry and save the new entry.