Script Caching

Difficulty: Advanced

Question

What is the purpose of SCRIPT LOAD and EVALSHA?

Answer

`SCRIPT LOAD` uploads a Lua script and returns a SHA1 hash. `EVALSHA` runs the script using that hash, saving bandwidth by not sending the full code every time.

Concepts covered

Lua, Performance