# SCRIPT FLUSH

> Remove every script from the script cache.

URL: https://docs.hotkv.com/commands/script-flush/

```
SCRIPT FLUSH [ASYNC | SYNC]
```

- Group: Scripting and functions
- Complexity: O(N) where N is the number of cached scripts
- HotKV Cloud: all plans
- On-Premise: no license needed

`SCRIPT FLUSH` empties the script cache. Afterwards [EVALSHA](https://docs.hotkv.com/commands/evalsha/index.md)
replies `NOSCRIPT` for every digest until the scripts are loaded again.
Function libraries are not affected (see
[FUNCTION FLUSH](https://docs.hotkv.com/commands/function-flush/index.md)). `ASYNC` and `SYNC` are accepted
for compatibility; the cache is emptied before the reply in both cases.

## Return value

| Case | RESP2 | RESP3 |
| --- | --- | --- |
| Always | Simple string `OK` | Simple string `OK` |

Any argument other than `ASYNC` or `SYNC` replies with
`ERR SCRIPT FLUSH only support SYNC|ASYNC option`.

## Examples

```
127.0.0.1:6379> SCRIPT FLUSH
OK
127.0.0.1:6379> SCRIPT EXISTS 098e0f0d1448c0a81dafe820f66d460eb09263da
1) (integer) 0
```

## Compatibility

Same replies as Redis 7 and Valkey 8.

## See also

[SCRIPT LOAD](https://docs.hotkv.com/commands/script-load/index.md), [SCRIPT EXISTS](https://docs.hotkv.com/commands/script-exists/index.md),
[FUNCTION FLUSH](https://docs.hotkv.com/commands/function-flush/index.md)