# CacheTraceEvent

Defined in: [packages/cache/src/cache.ts:36](https://github.com/jkomyno/knotkit/blob/ef04dc6fd5182dca281abddf3e1dcb13118c15a4/packages/cache/src/cache.ts#L36)

One thing a cache did, reported to [CacheOptions.trace](/reference/knotkit/cache/interfaces/cacheoptions/#trace) in the order it happened.

* `hit` and `miss`: a `get` found the key, or did not (an expired key reports `expire` first, then `miss`). `peek` and `has` report neither.
* `insert` and `update`: a `set` stored a key the cache did not hold, or replaced one it did. It follows the `evict` and `expire` events the same `set` caused.
* `evict`: the policy chose the key to make room; it is one of the entries `set` returns.
* `delete`: `delete` removed an unexpired key.
* `expire`: an entry was dropped because it had expired, by any member that found it, including `deleteExpired` and an eviction that reached it.

`clear` reports nothing.

## Type Parameters

### K

`K`

## Properties

### kind

> `readonly` **kind**: `"delete"` | `"hit"` | `"miss"` | `"insert"` | `"update"` | `"evict"` | `"expire"`

Defined in: [packages/cache/src/cache.ts:38](https://github.com/jkomyno/knotkit/blob/ef04dc6fd5182dca281abddf3e1dcb13118c15a4/packages/cache/src/cache.ts#L38)

What the cache did.

***

### key

> `readonly` **key**: `K`

Defined in: [packages/cache/src/cache.ts:40](https://github.com/jkomyno/knotkit/blob/ef04dc6fd5182dca281abddf3e1dcb13118c15a4/packages/cache/src/cache.ts#L40)

The key it did it to.
