add cache file functionality