SCRIPT EXISTS

SCRIPT EXISTS

SCRIPT EXISTS sha1
Available since
2.6.0
Time complexity
O(N) with N being the number of scripts to check (so checking a single script is an O(1) operation).
ACL categories
@slow, @scripting

Returns information about the existence of the scripts in the script cache.

This command accepts one or more SHA1 digests and returns a list of ones or zeros to signal if the scripts are already defined or not inside the script cache. This can be useful before a pipelining operation to ensure that scripts are loaded (and if not, to load them using SCRIPT LOAD) so that the pipelining operation can be performed solely using EVALSHA instead of EVAL to save bandwidth.

For more information about EVAL scripts please refer to Introduction to Eval Scripts.

Redict logo courtesy of @janWilejan, CC-BY-SA-4.0. Download SVG ⤑

Portions of this website courtesy of Salvatore Sanfilippo, CC-BY-SA-4.0.