Modified cache to be smarter
Merge pull request #31 from lossyrob/cache

Modified cache to be smarter