Optimization cache by @yaoli - copy

Test copy without ipdb import. Used to run clean tests on Travis.
Sure there is.  What do you think that the dict does with its keys?