# cache variable · @imqueue/rpc

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

Creates a `@cache()` method decorator that memoizes the decorated method's result in a cache adapter (RedisCache by default). On each call the cache is checked first; on a miss the method runs, and its result is stored under a key derived from the class name, method name, and arguments. The returned decorator is dual-mode: it works both as a standard (TC39) and as a legacy method decorator.

**Signature:**

```typescript
cache: CacheDecorator
```

