Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to list all the cached scripts in redis?

SCRIPT EXISTS sha1

The above will tell you if a script exists but is there a way to list all the cached scripts in redis?

thanks!

like image 827
kreek Avatar asked Sep 18 '15 01:09

kreek


People also ask

How do I view the contents of Redis cache?

After selecting a cache instance, you will be able to see all the databases with data in them. For a clustered cache, you would see shards instead. From there, you can expand a cache resource to view all the keys inside it. By clicking on a Redis key name, all its contents will open in a new editor tab.

How can I see all Redis keys?

To list the keys in the Redis data store, use the KEYS command followed by a specific pattern. Redis will search the keys for all the keys matching the specified pattern. In our example, we can use an asterisk (*) to match all the keys in the data store to get all the keys.

Which command is used to obtain all the keys in a database in Redis?

The Redis KEYS command returns all the keys in the database that match a pattern (or all the keys in the key space). Similar commands for fetching all the fields stored in a hash is HGETALL and for all fetching the members of a SMEMBERS. The keys in Redis themselves are stored in a dictionary (aka a hash table).

Which one is LIST command in Redis?

Basic commandsLPUSH adds a new element to the head of a list; RPUSH adds to the tail. LPOP removes and returns an element from the head of a list; RPOP does the same but from the tails of a list. LLEN returns the length of a list. LMOVE atomically moves elements from one list to another.


1 Answers

You can't do this, but what's the purpose of listing loaded scripts if the scripts need to be loaded from the application layer. That is, what scripts are loaded is a known information by your code.

I don't know what programming language or framework you're currently using in your solution, but whatever platform you're using, you just need to put some code to intercept the moment where you load a script to Redis and fire an event to be handled somewhere.

like image 147
Matías Fidemraizer Avatar answered Oct 02 '22 13:10

Matías Fidemraizer