Back to Redis

SCRIPT FLUSH

content/commands/script-flush.md

latest1.5 KB
Original Source

Flush the Lua scripts cache.

By default, SCRIPT FLUSH will synchronously flush the cache. Starting with Redis 6.2, 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]({{< relref "/commands/eval" >}}) scripts please refer to [Introduction to Eval Scripts]({{< relref "/develop/programmability/eval-intro" >}}).

Behavior change history

  • >= 6.2.0: Default flush behavior now configurable by the lazyfree-lazy-user-flush configuration directive.

Redis Software and Redis Cloud compatibility

| Redis Software | Redis Cloud | <span style="min-width: 9em; display: table-cell">Notes</span> | |:----------------------|:-----------------|:------| | <span title="Supported">✅ Standard</span> <span title="Supported"><nobr>✅ Active-Active</nobr></span> | <span title="Supported">✅ Standard</span> <span title="Supported"><nobr>✅ Active-Active</nobr></span> | |

Return information

{{< multitabs id="script-flush-return-info" tab1="RESP2" tab2="RESP3" >}}

Simple string reply: OK.

-tab-sep-

Simple string reply: OK.

{{< /multitabs >}}