{
  "id": "script-flush",
  "title": "SCRIPT FLUSH",
  "url": "https://redis.io/docs/latest/commands/script-flush/",
  "summary": "Removes all server-side Lua scripts from the script cache.",
  "tags": [
    "docs",
    "develop",
    "stack",
    "oss",
    "rs",
    "rc",
    "oss",
    "kubernetes",
    "clients"
  ],
  "last_updated": "2026-06-18T09:33:36-05:00",
  "page_type": "content",
  "content_hash": "e4dbad47d57cd21590c712447fe21cfb13af599659bb9feed42aa5430f1b17fd",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "Flush the Lua scripts cache.\n\nBy default, `SCRIPT FLUSH` will synchronously flush the cache.\nStarting with Redis 6.2, setting the `lazyfree-lazy-user-flush` configuration directive to `yes` changes the default flush mode to asynchronous.\n\nFor more information about [`EVAL`](https://redis.io/docs/latest/commands/eval) scripts please see [Introduction to Eval Scripts](https://redis.io/docs/latest/develop/programmability/eval-intro)."
    },
    {
      "id": "optional-arguments",
      "title": "Optional arguments",
      "role": "parameters",
      "text": "<details open><summary><code>ASYNC | SYNC</code></summary>\n\nFlush the script cache asynchronously (`ASYNC`) or synchronously (`SYNC`). The default is set by the `lazyfree-lazy-user-flush` configuration directive.\n\n</details>"
    },
    {
      "id": "details",
      "title": "Details",
      "role": "content",
      "text": ""
    },
    {
      "id": "behavior-change-history",
      "title": "Behavior change history",
      "role": "content",
      "text": "*   `>= 6.2.0`: Default flush behavior now configurable by the **lazyfree-lazy-user-flush** configuration directive."
    },
    {
      "id": "redis-software-and-redis-cloud-compatibility",
      "title": "Redis Software and Redis Cloud compatibility",
      "role": "content",
      "text": "| Redis<br />Software | Redis<br />Cloud | <span style=\"min-width: 9em; display: table-cell\">Notes</span> |\n|:----------------------|:-----------------|:------|\n| <span title=\"Supported\">&#x2705; Standard</span><br /><span title=\"Supported\"><nobr>&#x2705; Active-Active</nobr></span> | <span title=\"Supported\">&#x2705; Standard</span><br /><span title=\"Supported\"><nobr>&#x2705; Active-Active</nobr></span> |  |"
    },
    {
      "id": "return-information",
      "title": "Return information",
      "role": "returns",
      "text": "**RESP2:**\n\n[Simple string reply](../../develop/reference/protocol-spec#simple-strings): `OK`.\n\n**RESP3:**\n\n[Simple string reply](../../develop/reference/protocol-spec#simple-strings): `OK`."
    }
  ],
  "examples": []
}
