Skip to content

WithCacheOptions

Defined in: unstorage-utils.ts:25

Type Parameter
TArgs extends unknown[]
Property Type Description Inherited from Defined in
prefix? string Key prefix. Uses unstorage’s prefixStorage for proper scoping. CacheOptions.prefix unstorage-utils.ts:16
storage Storage unstorage instance — use any driver (memory, redis, fs, db, etc.). CacheOptions.storage unstorage-utils.ts:14
toKey? (…args) => string Convert the args to a cache key string. Defaults to hash(args) via ohash. - unstorage-utils.ts:30
ttl? number TTL in seconds. Passed to the driver via TransactionOptions (native TTL for redis, etc.) AND stored as expiresAt in the entry (fallback for drivers without native TTL). CacheOptions.ttl unstorage-utils.ts:22