Clearing all keys in a Redis cache

The redis-cli command can be used to remove or clear all the entries on a redis instance. This utility is installed along with the Redis server.

By default the command connects to Redis running on localhost. which for development is normally fine. The command to remove all entries is simply:

redis-cli FLUSHALL

This will return OK, to indicate that all the entries have been cleared successfully.

For connecting to remote Redis hosts and other options see the Redis CLI documentation.

Last updated: 24/10/2019