1
0
mirror of https://github.com/redis/node-redis.git synced 2026-10-24 08:19:27 +03:00

1 Commits

Author SHA1 Message Date
Pavel Pashov
365bbf6f0d feat(client): add OPTIN/OPTOUT tracking modes to client-side caching (#3473)
* feat(client): add OPTIN/OPTOUT tracking modes to client-side caching

Add a `trackingMode` option ("plain" | "optin" | "optout") and a
`cacheable(command, keys)` predicate to the client-side cache config,
and a per-call `cache` command option. Intent resolves as: the per-call
mark, then the predicate, then the mode default. Eligibility still wins.

`CLIENT CACHING YES|NO` is sent as a queue prelude of the read, so the
pair is admitted, cancelled, encoded, written, and failed as one unit.
When the flag fails, the reply is returned but not cached.

`handleCache` keeps its callback contract; tracking confirmation is an
optional trailing `isStorable` parameter, so existing custom providers
are unaffected.

* chore(client): fix cache lint errors

* feat(client): add experimental strict option to client-side caching

* feat(client): refuse user-sent CLIENT CACHING/TRACKING with client-side caching

* docs: add client-side caching docs

* docs(client): clarify caching with custom type mappings
2026-10-01 11:02:04 +03:00