It's ridiculous. Sure dropping everything is an easy way to go but it shouldn't work like that.
Maybe flushdb functionality could be configurable?
How you can solve this (together with another organization problem):
1) Introduce a cache key prefix. It should be configurable but never empty. Default value: 'cache'.
2) Add the prefix to each key passed into get/set/del methods. It should be separated with the key by a colon ':' (e.g. 'cache:custom_cache_key').
3) Make reset method to delete all keys starting with the prefix.
It's ridiculous. Sure dropping everything is an easy way to go but it shouldn't work like that. Maybe
flushdb
functionality could be configurable?How you can solve this (together with another organization problem): 1) Introduce a cache key prefix. It should be configurable but never empty. Default value: 'cache'. 2) Add the prefix to each
key
passed intoget/set/del
methods. It should be separated with thekey
by a colon ':' (e.g. 'cache:custom_cache_key'). 3) Makereset
method to delete all keys starting with the prefix.