# CacheWithOptions interface · @imqueue/pg-cache

Source: https://imqueue.org/api/pg-cache/latest/pg-cache.cachewithoptions/
Published: 2026-08-04
Author: @imqueue maintainers (https://github.com/imqueue)
Package: @imqueue/pg-cache 5.0.6 — generated reference, not hand-written

Options for the [cacheWith()](https://imqueue.org/api/pg-cache/latest/pg-cache.cachewith/) method decorator: which tables invalidate the cached result, how long it may live, and the tag it is stored under.

**Signature:**

```typescript
export interface CacheWithOptions 
```

## Properties


| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [channels](https://imqueue.org/api/pg-cache/latest/pg-cache.cachewithoptions.channels/) |  | string\[\] \| [FilteredChannels](https://imqueue.org/api/pg-cache/latest/pg-cache.filteredchannels/) | PgBubSub channels to listen for invalidation. Usually channels are table names. |
| [tag?](https://imqueue.org/api/pg-cache/latest/pg-cache.cachewithoptions.tag/) |  | string | _(Optional)_ Tag to use for this cache when set a value |
| [ttl?](https://imqueue.org/api/pg-cache/latest/pg-cache.cachewithoptions.ttl/) |  | number | _(Optional)_ Time to live in milliseconds. By default is equivalent to 24 hours |

