script-load.3valkey - Man Page

Loads a server-side Lua script to the script cache.

Synopsis

SCRIPT LOAD script

Description

Load a script into the scripts cache, without executing it. After the specified command is loaded into the script cache it will be callable using EVALSHA with the correct SHA1 digest of the script, exactly like after the first successful invocation of EVAL.

The script is guaranteed to stay in the script cache forever (unless SCRIPT FLUSH is called).

The command works in the same way even if the script was already present in the script cache.

For more information about EVAL scripts please refer to valkey-eval-intro(7) Introduction to Eval Scripts.

Reply

valkey-protocol(7) Bulk string reply: the SHA1 digest of the script added into the script cache.

Complexity

O(N) with N being the length in bytes of the script body.

Acl Categories

@scripting @slow

History

See Also

eval(3valkey), evalsha(3valkey), evalsha_ro(3valkey), eval_ro(3valkey), fcall(3valkey), fcall_ro(3valkey), function(3valkey), function-delete(3valkey), function-dump(3valkey), function-flush(3valkey), function-help(3valkey), function-kill(3valkey), function-list(3valkey), function-load(3valkey), function-restore(3valkey), function-stats(3valkey), script(3valkey), script-debug(3valkey), script-exists(3valkey), script-flush(3valkey), script-help(3valkey), script-kill(3valkey), script-show(3valkey)

Info

2024-09-23 8.0.0 Valkey Command Manual