Urgent.News

What's breaking now, across thousands of outlets.

Tech

CLIENT TRACKING landed in Redis 6 four years ago. StackExchange.Redis still doesn't support it.

The gap Redis 6 shipped CLIENT TRACKING in 2020: opt a connection in, and the server pushes an invalidation the moment a key you've read changes anywhere. It's the building block for a correct client-side cache — no TTL guessing, no serving stale data because nobody told you it changed. StackExchange.Redis never implemented it. The issue has been open since 2020([#1461(…

In 2020, Redis 6 introduced a feature called CLIENT TRACKING which allowed the server to push invalidations whenever a key a client had read changed anywhere. However, StackExchange.Redis, a popular .NET client for Redis, never implemented this feature. This left developers with an option to fork the project or find an alternative solution.

RedisNearCache is a package that sits alongside StackExchange.Redis. It enables developers to continue using their existing multiplexer, while simultaneously handling client tracking and invalidation. To use RedisNearCache, developers simply need to add a second connection and manage it through RedisNearCache. The API for RedisNearCache is identical to StackExchange.Redis, making the transition seamless.

There are two main modes for RedisNearCache: REDIRECT-based tracking for self-hosted, ElastiCache node-based, or Azure Cache for Redis; and Broadcast mode for Redis Enterprise-based services like Azure Managed Redis, Redis Cloud, or Redis Software. The Broadcast mode requires a separate RESP3 connection per master and subscription to invalidations for a key prefix.

A benchmark test compared RedisNearCache with other caching solutions like IMemoryCache, HybridCache, and FusionCache. The test showed that RedisNearCache provided accurate tracking and significantly reduced stale reads compared to TTL-based options. While TTL-based solutions may have higher raw throughput, they served stale data over 80% of the time in the tested workload. RedisNearCache, on the other hand, offered a more accurate and up-to-date caching experience, albeit with slightly lower raw throughput.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Everything New in iOS 27.2 Beta 1

Apple surprised us with the first beta of iOS 27.2 today instead of releasing an iOS 27.1 beta. Apple likely went straight to iOS 27.2 to keep iPhone Duo code under wraps for now, since we already…

datasette 0.65.5

Release: datasette 0.65.5 Security fix for an issue where a trailing newline in a requested table name could bypass table permissions and expose private rows, reported by dpfkdlemtp in…

datasette 1.0a40

Release: datasette 1.0a40 Same security fix as 0.65.5 , plus some neat new features and bug fixes: Plugins can now launch and manage background tasks using the new datasette.add_background_task()…

More from Wednesday 16 September →