Support for a Cache Key Generator

resolve #259
Initial commit for Cache Key Generator.
makes sense. And yes, reversing the ternary is better :-)