the cache code