Latest web development tutorials

Redis Script Load command

Redis script

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

EVAL command will also add a script to the script cache, but it will immediately evaluate the script input.

If the given script is already in the cache, then do nothing.

After the script is added to the cache by EVALSHA command, you can use the SHA1 checksum script and invoke the script.

Script can keep an unlimited length of time in the cache until the execution SCRIPT FLUSH so far.

For more information about using Redis Lua script to be evaluated, see the EVAL command.

grammar

redis Script Load basic command syntax is as follows:

redis 127.0.0.1:6379> SCRIPT LOAD script

Available versions

> = 2.6.0

return value

Given the script SHA1 checksum

Examples

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

Redis script