question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

FastImage.cache.web does not work on Android

See original GitHub issue

FastImage.cache.web - Use headers and follow normal caching procedures.

@DylanVann The image view does not render when use the property cache: ‘web’

<FastImage
    source={{
    uri: source.uri,
    cache: 'web'
}}/>                                                         

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:12

github_iconTop GitHub Comments

2reactions
rogarMScommented, Mar 24, 2020

I dug into this as it was a blocker for me using it. Seems like the OkHttpClient didn’t have a cache configured.

I fixed this locally with a patch. (using patch-package) In FastImageOkHttpProgressGlideModule.java I added a cache

         OkHttpClient client = OkHttpClientProvider
                 .getOkHttpClient()
                 .newBuilder()
+                .cache(new Cache(
+                    new File(context.getCacheDir(), "image-cache"),
+                    100 * 1024 * 1024))
                 .addInterceptor(createInterceptor(progressListener))
                 .build();

Replace “100 * 1024 * 1024” with whatever cache size you want.

Disclaimer. I’m not sure if this affects the other caching methods, but I always want to use web in my app, so I wasn’t concerned.

1reaction
sallarcommented, Oct 8, 2020

Hi, seems like this issue is not getting any attention. Are there other image solutions that have proper caching?

Read more comments on GitHub >

github_iconTop Results From Across the Web

React Native Fast Image Caching - Stack Overflow
The cache: FastImage.cacheControl.cacheOnly from FastImage means it wont do any network request, it will just try to find from the cache.
Read more >
react-native-fast-image - npm
React Native's Image component handles image caching like browsers for the ... FastImage is an Image replacement that solves these issues.
Read more >
React Native Fast Image Cache Package - Android iOS Example
React native fast image NPM package is one of the best image ... cacheOnly – Only show images from cache, do not make...
Read more >
react-native-fast-image | Yarn - Package Manager
Flickering. Cache misses. Low performance loading from cache. Low performance in general. FastImage is an Image replacement that solves these issues. FastImage ......
Read more >
Caching images in React Native: A tutorial with examples
Caching is a great way to solve issues associated with loading and ... react-native-fast-image is a performant React Native component for ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found