Attempts to create the cache file before writing to it.