I keep a cached object in Redis that several workers read and occasionally rewrite. Before writing, each worker has to check that nobody else changed the object since it was last read, or the write clobbers someone else's update. Redis never had one command for that. You used WATCH / MULTI / EXEC , or a Lua script that reads and compares server-side, or you accepted the race and moved on.
Redis 8.4 adds four conditions to SET : IFEQ , IFNE , IFDEQ and IFDNE . The first two compare against a literal value. The last two compare against a digest, a 16-character hex hash the server computes with DIGEST . I pulled redis:8.4 and ran all four against the patterns they replace.
The headline number
The point of a digest is that you don't send the value you're comparing against, you send its hash. For a small string that saves nothing.…