react-native-image-cache-hoc icon indicating copy to clipboard operation
react-native-image-cache-hoc copied to clipboard

Permanent CacheableImages should not pull from local cache dir only permanent dir

Open billmalarky opened this issue 7 years ago • 2 comments

Currently FileSystem.getLocalFilePathFromUrl() checks if a file exists in either the local cache or permanent directories before hitting the network and saving to the appropriate local dir.

If the permanent prop flag is set to true, we should hit the network even if the file already exists in the local cache dir because cache dir files are ephemeral and the permanent prop should not rely on them (what if the user wants this image to render in a future render even if at that point in time the app does not have internet access).

Better yet, if permanent prop is set and the file exists in the cache dir but not the permanent dir, ignore the network and just copy the local file from cache dir to permanent dir.

billmalarky avatar Nov 09 '17 19:11 billmalarky

it is a bug or future ?

alien3d avatar Nov 10 '17 15:11 alien3d

Both?

Nothing is broken, it's just making behavior more in line with expectations.

billmalarky avatar Nov 10 '17 15:11 billmalarky