smarter and faster hash caching