What's new in Valkey 9.0? Discover new features and improvements. Read the announcement.

SCRIPT FLUSH

Removes all server-side Lua scripts from the script cache.

Usage
SCRIPT FLUSH [flush-type]
Complexity
O(N) with N being the number of scripts in cache
Since
2.6.0
ACL Categories
@scripting, @slow
Command flags
NOSCRIPT, STALE

Flush the Lua scripts cache.

By default, SCRIPT FLUSH will synchronously flush the cache. Setting the lazyfree-lazy-user-flush configuration directive to "yes" changes the default flush mode to asynchronous.

It is possible to use one of the following modifiers to dictate the flushing mode explicitly:

  • ASYNC: flushes the cache asynchronously
  • SYNC: flushes the cache synchronously

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

Replies

RESP2

RESP3

History

  • 6.2.0: Added the `ASYNC` and `SYNC` flushing mode modifiers.