Repository navigation
feat(android): share Fresco disk cache with Image.prefetch, new example app - #213
Merged
Merged
Conversation
Image.prefetch(url) and <Image> store remote images in Fresco's main disk cache. Look up the URL there before opening a network connection so a prefetched image is not downloaded again. Falls back to the existing network path on cache miss or lookup failure. iOS already reuses the cache since it loads through RCTImageLoader.
On a cache miss, cropImage now downloads the image (with the given headers) into Fresco's main disk cache and reads it from there, so a later <Image> with the same URL loads it from disk. Falls back to a plain download if the cache can't be used. Also fixes the nullable BinaryResource returned by FileCache.insert in Fresco 3.x.
Fresh RN 0.87.1 app linked to the library via link:.. with Metro watching the repo root. New single-screen playground covering every cropImage option (sources incl. headers, data: and file:// URIs, crop box with aspect presets, format, quality, base64, displaySize/resizeMode) plus a cache lab for Image.prefetch / <Image> cache reuse. Adds screenshots to the example and root READMEs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
cropImagereads remote images from Fresco's disk cache (filled byImage.prefetch/<Image>) and stores downloads there on miss.cropImageoptions, with screenshots in the READMEs.