cache functions now takes in input the cache file