lib/fc: directories and permissions are checked when generating a cache filename, not when storing