{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/fresco/issues/80","labels_url":"https://api.github.com/repos/facebook/fresco/issues/80/labels{/name}","comments_url":"https://api.github.com/repos/facebook/fresco/issues/80/comments","events_url":"https://api.github.com/repos/facebook/fresco/issues/80/events","html_url":"https://github.com/facebook/fresco/issues/80","id":66062296,"number":80,"title":"Feature Request to Expose Cached Files ","user":{"login":"shanus","id":48598,"avatar_url":"https://avatars.githubusercontent.com/u/48598?v=3","gravatar_id":"","url":"https://api.github.com/users/shanus","html_url":"https://github.com/shanus","followers_url":"https://api.github.com/users/shanus/followers","following_url":"https://api.github.com/users/shanus/following{/other_user}","gists_url":"https://api.github.com/users/shanus/gists{/gist_id}","starred_url":"https://api.github.com/users/shanus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shanus/subscriptions","organizations_url":"https://api.github.com/users/shanus/orgs","repos_url":"https://api.github.com/users/shanus/repos","events_url":"https://api.github.com/users/shanus/events{/privacy}","received_events_url":"https://api.github.com/users/shanus/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/facebook/fresco/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-04-03T03:03:53Z","updated_at":"2015-04-03T17:50:09Z","closed_at":"2015-04-03T17:23:25Z","body":"It would be nice to have the ability to see if the image has already been cached to disk and/or memory.  A simple call like\r\n\r\n    Fresco.existsInDiskCache(Uri uri) and Fresco.existsInMemoryCache(Uri uri)\r\n\r\nMaybe a separate request but related is the ability to retrieve the cached resource from disk.  The use case being that after we have retrieved the image the app may have a feature that allows the user to share the image.  If we could access the local uri of the cached image then we can pass it to share intent. "},"comment":{"url":"https://api.github.com/repos/facebook/fresco/issues/comments/89373942","html_url":"https://github.com/facebook/fresco/issues/80#issuecomment-89373942","issue_url":"https://api.github.com/repos/facebook/fresco/issues/80","id":89373942,"user":{"login":"shanus","id":48598,"avatar_url":"https://avatars.githubusercontent.com/u/48598?v=3","gravatar_id":"","url":"https://api.github.com/users/shanus","html_url":"https://github.com/shanus","followers_url":"https://api.github.com/users/shanus/followers","following_url":"https://api.github.com/users/shanus/following{/other_user}","gists_url":"https://api.github.com/users/shanus/gists{/gist_id}","starred_url":"https://api.github.com/users/shanus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shanus/subscriptions","organizations_url":"https://api.github.com/users/shanus/orgs","repos_url":"https://api.github.com/users/shanus/repos","events_url":"https://api.github.com/users/shanus/events{/privacy}","received_events_url":"https://api.github.com/users/shanus/received_events","type":"User","site_admin":false},"created_at":"2015-04-03T17:50:09Z","updated_at":"2015-04-03T17:50:09Z","body":"The reason you may want to know if the image is in the cache or not is to be able to present to the user a status of how available the app is for offline use.  For example, if you have a photo gallery of 80 images pulled from remotes urls it would be useful to display to the user that they have 65 images of 80 cached locally so they can view them even when they are not connected to a network.  Of course they would be able to see that in the photogallery but that may be after the fact.\r\n\r\nAnother similar case is giving the user the ability to tap a button to download all images which prompts a sync adapter to pull the 80 images using your prefetching capability.  We can easily do that part but we lose the ability to show the user that all of the images were successfully retrieved and not subsequently purged from the cache.  Instead of having a callback and creating a data store recording which images are downloaded to have another view show progress (and which would later be out of date if the certain images were cleared from the cache).  We could have a view check to see which images were in the cache and display the progress to the user.\r\n\r\nThere is value in knowing whether an image is present in the disk cache and thus persistable.  It is also completely understood why you don't want to expose the file name per se and it sounds like that is not needed because we can use the method you propose above.  However, knowing whether the image is is in the disk cache would be very useful.  Maybe something you want to think about is making a flag on certain items so they will not be removed unless a hard flush of the cache is performed."}}