change interface, rewrite cache code

rewrite the add, update, find and delete function. In other words, I
rewrite all the code of cache.