implementation of the cache functions