"Set Cache Value": Support Redis SET NX and boolean return

Hi Xano Team,

I’d like to suggest an improvement to the "Set Cache Value" function to better support high-performance and concurrency-safe architectures. Currently, this function appears to map to the Redis command SET key value EX ttl, which is perfectly fine for general caching use cases. However, in more advanced and professional systems, Redis is not only used for caching but also for distributed locking and preventing race conditions.

Redis natively supports this pattern using SET key value NX EX ttl, where the NX flag ensures the key is only set if it does not already exist. This is a widely recommended approach for implementing locks and coordinating concurrent processes.

Xano already provides solid support for concurrency control at the database level, for example with PostgreSQL transactions using lock = true. However, there is currently no equivalent mechanism when using Redis through "Set Cache Value".

A simple but powerful improvement would be to add an optional parameter (e.g., set_if_not_exists) to this function. When enabled, Xano would execute SET key value NX EX ttl instead of the current command. Additionally, the function could return a boolean value indicating whether the key was actually set.

This would enable proper use of Redis for distributed locking, help prevent race conditions in high-concurrency environments, reduce reliance on database-level locks, and align Xano with standard Redis best practices. It would also unlock more advanced backend patterns such as idempotency control and job coordination. Supporting this pattern would significantly expand what developers can safely and efficiently build on Xano.

Thanks for considering this improvement. I believe it would add real value for teams building scalable and robust systems on the platform.

FA

1