Documentation / @zerotal/cache / index / CacheConfigShape
Interface: CacheConfigShape
Defined in: cache/src/config.ts:3
Properties
driver
driver:
"memory"|"sqlite"|"redis"
Defined in: cache/src/config.ts:5
Which cache driver to use. Default: 'sqlite'
prefix
prefix:
string
Defined in: cache/src/config.ts:12
Key prefix prepended to all cache keys. Default: 'zerotal:cache:'.
This MUST stay distinct from the queue driver's zerotal:jobs: namespace —
a shared zerotal: prefix meant Cache.flush() (KEYS zerotal:* + DEL) also
deleted every pending/failed job on the same Redis DB.
ttl
ttl:
number
Defined in: cache/src/config.ts:14
Default TTL in seconds. Default: 3600 (1 hour)
stampedeProtection
stampedeProtection:
boolean
Defined in: cache/src/config.ts:20
Guard remember() recomputes with a cross-process lock so only one node runs the
factory on a cold key (cache stampede protection). Requires a lock driver to be
configured; degrades to in-process coalescing otherwise. Default: true.
sqlite
sqlite:
object
Defined in: cache/src/config.ts:22
SQLite-specific options
path
path:
string
Path to the SQLite file. Use ':memory:' for in-process cache.