re-work cache backend to be more flexible and support for redis