MemcachedCacheOptions
Defined in: src/cache/MemcachedCache.ts:28
Memcached-backed Cache — wraps memjs (pure-JS memcached client,
tiny, well-maintained). Useful for shops with existing memcached
infrastructure; in greenfield setups Redis is the better default
(richer primitives, better cluster story).
Wire format:
- Values are JSON-stringified before send and parsed on receive.
- TTLs are passed as seconds (memcached’s native unit) — the interface uses milliseconds, we round up to the nearest second internally with a 1s minimum.
incruses memcached’s atomic INCR with a CAS-based create fallback for the first-key-write (memcached’sincrdoesn’t auto-create like Redis does).setIfAbsentmaps to memcached’saddoperation.
Failure model matches RedisCache: get/set/delete swallow
transient errors; incr and setIfAbsent propagate so callers can
detect lost atomicity.
Properties
Section titled “Properties”client?
Section titled “client?”
readonlyoptionalclient?:MemcachedClientLike
Defined in: src/cache/MemcachedCache.ts:37
Pre-built memjs client — bypass internal construction.
keyPrefix?
Section titled “keyPrefix?”
readonlyoptionalkeyPrefix?:string
Defined in: src/cache/MemcachedCache.ts:35
Optional key prefix (server-side, applied to every operation).
password?
Section titled “password?”
readonlyoptionalpassword?:string
Defined in: src/cache/MemcachedCache.ts:33
servers?
Section titled “servers?”
readonlyoptionalservers?:string
Defined in: src/cache/MemcachedCache.ts:30
Comma-separated server list, e.g. 'localhost:11211'. Default: 'localhost:11211'.
username?
Section titled “username?”
readonlyoptionalusername?:string
Defined in: src/cache/MemcachedCache.ts:32
Optional username/password for SASL auth.