Skip to content

Ask the HotKV docs

Answers come only from these docs and can be wrong; check the linked pages before you rely on them.

EVALSHA_RO

Last updated
EVALSHA_RO sha1 numkeys [key [key ...]] [arg [arg ...]]
Group
Scripting and functions
Complexity
Depends on the script
Arity
-3 (at least 3 words, counting the command name)
Flags
slow, read-only
HotKV Cloud
All plans
On-Premise
no license needed

EVALSHA_RO runs a cached script by its SHA1 digest, like EVALSHA, with the read-only rules of EVAL_RO: the script may not write, and the command can be sent to read-only replicas.

The script’s return value, converted as described for EVAL.

Errors:

  • NOSCRIPT No matching script. Please use EVAL. when the digest is not cached.
  • The read-only errors of EVAL_RO.
127.0.0.1:6379> SCRIPT LOAD "return redis.call('GET', KEYS[1])"
"d3c21d0c2b9ca22f82737626a27bcaf5d288f99f"
127.0.0.1:6379> EVALSHA_RO d3c21d0c2b9ca22f82737626a27bcaf5d288f99f 1 greeting
"hello"

Same as Redis 7 and Valkey 8.

EVALSHA, EVAL_RO, SCRIPT LOAD