Skip to content

Adding support for the broadcast mode - #4539

Open
vrubal wants to merge 1 commit into
redis:masterfrom
vrubal:topic/vrubal/client-side-cache-broadcast-support
Open

Adding support for the broadcast mode#4539
vrubal wants to merge 1 commit into
redis:masterfrom
vrubal:topic/vrubal/client-side-cache-broadcast-support

Conversation

@vrubal

@vrubal vrubal commented May 24, 2026

Copy link
Copy Markdown

Note

Medium Risk
Changes how invalidations are scoped (prefix-based broadcast vs per-connection tracking), which can cause stale cache entries if misconfigured; defaults preserve prior non-BCAST behavior.

Overview
Adds Redis CLIENT TRACKING BCAST mode to client-side caching so invalidations can follow prefix filters instead of only keys this connection has read.

Configuration flows through CacheConfig (bcast(), prefixes(...), noloop()), the Cache API (isBroadcastMode, getPrefixes, isNoLoop), AbstractCache / DefaultCache, and CacheFactory (including optional constructors on custom cache types). CacheConnection now builds tracking arguments dynamically (TRACKING ON, optional BCAST + PREFIX, optional NOLOOP) instead of a fixed TRACKING ON.

Tests cover config/factory wiring (BroadcastTrackingArgsTest) and Redis 7.4+ behavior: prefixed keys invalidate on external writes; non-prefixed keys do not when prefixes are set (BroadcastTrackingIntegrationTest).

Reviewed by Cursor Bugbot for commit c04462e. Bugbot is set up for automated code reviews on this repo. Configure here.

@jit-ci

jit-ci Bot commented May 24, 2026

Copy link
Copy Markdown

Hi, I’m Jit, a friendly security platform designed to help developers build secure applications from day zero with an MVS (Minimal viable security) mindset.

In case there are security findings, they will be communicated to you as a comment inside the PR.

Hope you’ll enjoy using Jit.

Questions? Comments? Want to learn more? Get in touch with us.

@atakavci

Copy link
Copy Markdown
Contributor

hey @vrubal ,,

This is actually one of those standing in our TODO list with no concrete timeline as of now,,, so thank you 🕺 for taking the time for this PR.

This will be a part of a bigger effort around CSC, so we need to evaluate this in that sense.
Unfortunately, i will be off until next week, so, i'll look into this somewhere in the next week hopefully.
Thank you for your patience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants