> ## Documentation Index
> Fetch the complete documentation index at: https://docs.revoengine.com/llms.txt
> Use this file to discover all available pages before exploring further.

# api.setCache()

> Public low-code contract, signatures and examples for api.setCache.

## `api.setCache()`

Writes execution-scoped in-memory cache. Copies the value by default.
`&#123; reference: true &#125;` retains the same object: later mutations of the input
or returned value change the cached value. Use only for intentional reuse
within this execution; refresh or overwrite after a write to the source.

### Signature

```ts theme={null}
static setCache(key: string, value: any, options?: { reference?: boolean }): void;
```

### Example

```ts theme={null}
api.setCache('token', 'abc');
api.setCache('rows', rows, { reference: true });
```

See [all api methods](https://docs.revoengine.com/low-code/reference/api.md) or [runtime basics](https://docs.revoengine.com/low-code/overview.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.