Redis Script Load Command

Redis Scripts

The Redis Script Load command is used to add the script to the script cache, but does not immediately execute this script.

EVALThe EVAL command also adds the script to the script cache, but it immediately evaluates the input script.

If the given script is already in the cache, no operation is performed.

After the script has been added to the cache, through theEVALSHAcommand, you can use the script's SHA1 checksum to call this script.

The script can be kept in the cache for an unlimited time, until the execution ofSCRIPT FLUSHis complete.

For more information about using Redis to evaluate Lua scripts, please seeEVALcommand.

Syntax

The basic syntax of the redis Script Load command is as follows:

redis 127.0.0.1:6379> SCRIPT LOAD script

Available Versions

>= 2.6.0

Return Value

The SHA1 checksum of the given script.

Examples

redis 127.0.0.1:6379> SCRIPT LOAD "return 1"
"e0e1f9fabfc9d4800c877a703b823ac0578ff8db"

Redis Scripts

Other Extensions