add flexible key generate policy

In my project, I want to add custom policy to generate cache key for my request. so I add this new branch