don't try to write the cache file if directory is unwritable